<template>
  <div class="ele-body">
    <div v-show="loading"
         class="loading-div"
         v-loading="loading"
         element-loading-text="努力提交中..."
         :style="{ height: windowHeight + 'px' }">
    </div>
    <el-card shadow="never">
      <div class="zfb-purple"
           v-loading="loadingResubmit"
           :style="loadingResubmit?{ height: windowHeight + 'px' }:''"
           element-loading-text="加载中..."
           v-if="incomingStatus == 1 || incomingStatus == 7">
        <div class="fromSubmitOne">
          <h6 class="hLabel">选择进件类型</h6>
          <div :class="[
              IncomingOrNot == 0
                ? 'incomingTypeSwitch'
                : 'active-incomingTypeSwitch'
            ]">
            <!-- 微信 -->
            <div :class="[
                selectIncomingTypeStatus == 0
                  ? 'active-wxIncoming'
                  : 'wxIncoming'
              ]"
                 @click="incomingType(0)">
              <div class="wxHLabel"></div>

              <div class="wxText">
                <div :class="[
                    selectIncomingTypeStatus == 0
                      ? 'activr-wxTextFontSize'
                      : 'wxTextFontSize'
                  ]">微信进件</div>
                <div :style="customStyle">{{
                  IncomingStatus(IncomingOrNot)
                }}</div>
              </div>
            </div>
            <!-- 支付宝 -->
            <div :class="[
                selectIncomingTypeStatus == 1
                  ? 'active-zfbIncoming'
                  : 'zfbIncoming'
              ]"
                 @click="incomingType(1)">
              <div class="zfbHLabel"></div>

              <div class="zfbText">
                <div :class="[
                    selectIncomingTypeStatus == 1
                      ? 'activr-zfbTextFontSize'
                      : 'zfbTextFontSize'
                  ]">支付宝进件</div>
                <div>{{ IncomingOrNot == 3 ? '已经进件' : '未进件' }}</div>
              </div>
            </div>
          </div>
          <incomingDetails v-if="incomingStatus == 7"
                           :detailsList="detailsList"></incomingDetails>

          <div v-show="selectIncomingTypeStatus == 0 && incomingStatus == 1">
            <el-form :label-position="labelPosition"
                     label-width="100px"
                     :rules="rules"
                     ref="wxSumbitForm"
                     :model="wxSumbitForm"
                     class="ruleForm">
              <div class="rejectReasonCss"
                   v-if="rejectReason">
                驳回原因:{{ rejectReason }}
              </div>
              <h6 class="hLabel">主体信息</h6>
              <el-form-item label="入驻类型"
                            prop="subjectType">
                <div class="subjectTypeSwitch">
                  <!-- 个体 -->
                  <div :class="[
                      wxSumbitForm.subjectType == 'SUBJECT_TYPE_INDIVIDUAL'
                        ? 'individuality'
                        : 'active-individuality'
                    ]"
                       @click="switchType('SUBJECT_TYPE_INDIVIDUAL')">个体工商户</div>
                  <!-- 企业 -->
                  <div :class="[
                      wxSumbitForm.subjectType == 'SUBJECT_TYPE_ENTERPRISE'
                        ? 'active-enterprise'
                        : 'enterprise'
                    ]"
                       @click="switchType('SUBJECT_TYPE_ENTERPRISE')">企业</div>
                </div>
              </el-form-item>
              <el-form-item label="商户简称"
                            prop="merchantShortname">
                <el-input v-model="wxSumbitForm.merchantShortname"
                          placeholder="请选择商户简称"></el-input>

              </el-form-item>

              <el-form-item label="所在行业"
                            prop="qualificationType">
                <el-select v-model="wxSumbitForm.qualificationType"
                           placeholder="请选择所在行业"
                           @change="
                    (event) => verifyChangesFn(event, 'qualificationType')
                  ">
                  <el-option v-for="item in qualificationTypeOptions"
                             :key="item.value"
                             :label="item.label"
                             :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="营业执照名称"
                            prop="merchantName">
                <el-input v-model="wxSumbitForm.merchantName"
                          placeholder="请选择营业执照名称"></el-input>
                <span>注意:【请填写营业执照的商家名称，2~110个字符,支持括号】</span>
              </el-form-item>
              <el-form-item label="营业执照编号"
                            prop="licenseNumber">
                <el-input v-model="wxSumbitForm.licenseNumber"
                          placeholder="请填写营业执照编号"></el-input>
                <span>注意:【请填写营业执照上的注册号/统一社会信用代码,须为18位数字|大写字母】</span>
              </el-form-item>
              <div class="businessLicenseTime">
                <el-form-item prop="periodBegin"
                              label="营业执照注册时间">
                  <el-date-picker v-model="wxSumbitForm.periodBegin"
                                  type="datetime"
                                  value-format="yyyy-MM-dd"
                                  placeholder="营业执照注册时间"
                                  @change="(event) => businessLicense(event, 'periodBegin')">
                  </el-date-picker>
                </el-form-item>
                <el-form-item :prop="wxSumbitForm.checked ? '' : 'periodEnd'"
                              label="营业执照结束时间">
                  <el-date-picker v-model="wxSumbitForm.periodEnd"
                                  type="datetime"
                                  :disabled="wxSumbitForm.checked"
                                  value-format="yyyy-MM-dd"
                                  placeholder="营业执照结束时间"
                                  @change="(event) => businessLicense(event, 'periodEnd')">
                  </el-date-picker>
                </el-form-item>
                <!-- 长期有效 	 -->

                <el-checkbox style="margin: 22px 0 0 30px"
                             v-model="wxSumbitForm.checked"
                             @change="switchCheckbox">长期有效</el-checkbox>
              </div>
              <span style="display: block;">注意:【如果营业执照无结束时间请勾选长期有效】</span>
              <el-form-item label="营业执照地址"
                            prop="licenseAddress">
                <el-input v-model="wxSumbitForm.licenseAddress"></el-input>
              </el-form-item>
              <!-- 营业执照 -->
              <el-form-item label="营业执照"
                            prop="licenseCopy">
                <el-upload list-type="picture-card"
                           action="#"
                           ref="pictureUploadLicenseCopy"
                           :on-exceed="exceedFn"
                           :file-list="licenseCopyFileList"
                           :on-change="
                    (files, fileList) =>
                      handleFileChange(files, fileList, 'licenseCopy')
                  "
                           :limit="1"
                           :auto-upload="false">
                  <i slot="default"
                     class="el-icon-download">
                    <div style="font-size: 14px; margin-top: 20px"
                         slot="default">点击上传</div>
                  </i>

                  <div slot="file"
                       slot-scope="{ file }">
                    <img v-if="!isImageUrl"
                         class="el-upload-list__item-thumbnail"
                         :src="file.url"
                         alt="" />

                    <img v-if="isImageUrl"
                         class="el-upload-list__item-thumbnail"
                         :src="imageUrl"
                         alt="" />
                    <span class="el-upload-list__item-actions">
                      <!-- 图片的预览 -->
                      <span class="el-upload-list__item-preview"
                            @click="handlePictureCardPreview(file)">
                        <i class="el-icon-zoom-in"></i>
                      </span>
                      <!-- 图片的下载 -->
                      <span v-if="!disabled"
                            class="el-upload-list__item-delete"
                            @click="handleDownload(file)">
                        <i class="el-icon-download"></i>
                      </span>
                      <!-- 图片的移除 -->
                      <span v-if="!disabled"
                            class="el-upload-list__item-delete"
                            @click="handleRemove(file, 'licenseCopy')">
                        <i class="el-icon-delete"></i>
                      </span>
                    </span>
                  </div>
                </el-upload>

                <span>注意:【请上传证件的彩色扫描件或彩色数码拍摄件，黑白复印件需加盖公章（公章信息需完整)】</span>
              </el-form-item>

              <!-- 门头照片 -->
              <el-form-item label="门头照片"
                            prop="storeEntrancePic">
                <el-upload action="#"
                           ref="pictureUploadStoreEntrancePic"
                           list-type="picture-card"
                           :limit="5"
                           :on-exceed="exceedFn"
                           :file-list="storeEntrancePicFileList"
                           :on-change="
                    (files, fileList) =>
                      handleFileChange(files, fileList, 'storeEntrancePic')
                  "
                           :auto-upload="false">
                  <i slot="default"
                     class="el-icon-download">
                    <div style="font-size: 14px; margin-top: 20px"
                         slot="default">点击上传</div>
                  </i>

                  <div slot="file"
                       slot-scope="{ file }">
                    <img v-if="!isImageUrl"
                         class="el-upload-list__item-thumbnail"
                         :src="file.url"
                         alt="" />

                    <img v-if="isImageUrl"
                         class="el-upload-list__item-thumbnail"
                         :src="imageUrl"
                         alt="" />
                    <span class="el-upload-list__item-actions">
                      <!-- 图片的预览 -->
                      <span class="el-upload-list__item-preview"
                            @click="handlePictureCardPreview(file)">
                        <i class="el-icon-zoom-in"></i>
                      </span>
                      <!-- 图片的下载 -->
                      <span v-if="!disabled"
                            class="el-upload-list__item-delete"
                            @click="handleDownload(file)">
                        <i class="el-icon-download"></i>
                      </span>
                      <!-- 图片的移除 -->
                      <span v-if="!disabled"
                            class="el-upload-list__item-delete"
                            @click="handleRemove(file, 'storeEntrancePic')">
                        <i class="el-icon-delete"></i>
                      </span>
                    </span>
                  </div>
                </el-upload>

                <span>注意:【门头照片必须要要与营业执照的名称相关，否则人工审核会失败】</span>
              </el-form-item>
              <!-- 办公环境 -->
              <el-form-item label="办公环境"
                            prop="indoorPic">
                <el-upload action="#"
                           ref="pictureUploadIndoorPic"
                           list-type="picture-card"
                           :limit="5"
                           :file-list="indoorPicFileList"
                           :on-exceed="exceedFn"
                           :on-change="
                    (file, fileList) =>
                      handleFileChange(file, fileList, 'indoorPic')
                  "
                           :auto-upload="false">
                  <i slot="default"
                     class="el-icon-download">
                    <div style="font-size: 14px; margin-top: 20px"
                         slot="default">点击上传</div>
                  </i>

                  <div slot="file"
                       slot-scope="{ file }">
                    <img class="el-upload-list__item-thumbnail"
                         :src="file.url"
                         alt="" />
                    <span class="el-upload-list__item-actions">
                      <!-- 图片的预览 -->
                      <span class="el-upload-list__item-preview"
                            @click="handlePictureCardPreview(file)">
                        <i class="el-icon-zoom-in"></i>
                      </span>
                      <!-- 图片的下载 -->
                      <span v-if="!disabled"
                            class="el-upload-list__item-delete"
                            @click="handleDownload(file)">
                        <i class="el-icon-download"></i>
                      </span>
                      <!-- 图片的移除 -->
                      <span v-if="!disabled"
                            class="el-upload-list__item-delete"
                            @click="handleRemove(file, 'indoorPic')">
                        <i class="el-icon-delete"></i>
                      </span>
                    </span>
                  </div>
                </el-upload>

                <span>注意:【办公环境如:餐饮店的照片、办公室、公司前台等照片...】</span>
              </el-form-item>
              <!-- 特殊资质 -->
              <el-form-item label="特殊资质"
                            prop="qualifications"
                            v-if="selectIncomingTypeStatus !== 1">
                <el-upload action="#"
                           ref="pictureUploadQualifications"
                           list-type="picture-card"
                           :limit="5"
                           :on-exceed="exceedFn"
                           :file-list="qualificationsFileList"
                           :on-change="
                    (file, fileList) =>
                      handleFileChange(file, fileList, 'qualifications')
                  "
                           :auto-upload="false">
                  <i slot="default"
                     class="el-icon-download">
                    <div style="font-size: 14px; margin-top: 20px"
                         slot="default">点击上传</div>
                  </i>

                  <div slot="file"
                       slot-scope="{ file }">
                    <img class="el-upload-list__item-thumbnail"
                         :src="file.url"
                         alt="" />
                    <span class="el-upload-list__item-actions">
                      <!-- 图片的预览 -->
                      <span class="el-upload-list__item-preview"
                            @click="handlePictureCardPreview(file)">
                        <i class="el-icon-zoom-in"></i>
                      </span>
                      <!-- 图片的下载 -->
                      <span v-if="!disabled"
                            class="el-upload-list__item-delete"
                            @click="handleDownload(file)">
                        <i class="el-icon-download"></i>
                      </span>
                      <!-- 图片的移除 -->
                      <span v-if="!disabled"
                            class="el-upload-list__item-delete"
                            @click="handleRemove(file, 'qualifications')">
                        <i class="el-icon-delete"></i>
                      </span>
                    </span>
                  </div>
                </el-upload>

                <span>注意:【根据商户经营业务要求提供相关资质，非必填...】</span>
              </el-form-item>

              <div class="fromSubmitTwo">
                <h6 class="hLabel">法人/负责人信息</h6>

                <el-form-item label="姓名"
                              prop="legalPerson">
                  <el-input placeholder="请输入姓名"
                            v-model="wxSumbitForm.legalPerson"
                            @change="inputFn"></el-input>
                </el-form-item>
                <el-form-item label="证件类型"
                              prop="idDocType">
                  <el-select v-model="wxSumbitForm.idDocType"
                             placeholder="请选择证件类型"
                             @change="verifyChangesFn">
                    <el-option v-for="item in idDocTypeOptions"
                               :key="item.value"
                               :label="item.label"
                               :value="item.value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="身份证号"
                              prop="idCardNumber">
                  <el-input placeholder="请输入身份证"
                            v-model="wxSumbitForm.idCardNumber"
                            show-password></el-input>
                </el-form-item>
                <!-- 身份证正反面 -->
                <div class="positiveAndNegativeIDcards">
                  <!-- 身份证正面 -->
                  <el-form-item label="身份证正面"
                                prop="idCardCopy"
                                class="positiveIDcards">
                    <el-upload action="#"
                               ref="pictureUploadIdCardCopy"
                               :limit="1"
                               :on-exceed="exceedFn"
                               :file-list="idCardCopyFileList"
                               :on-change="
                        (file, fileList) =>
                          handleFileChange(file, fileList, 'idCardCopy')
                      "
                               list-type="picture-card"
                               :auto-upload="false">
                      <i slot="default"
                         class="el-icon-download">
                        <div style="font-size: 14px; margin-top: 20px"
                             slot="default">点击上传</div>
                      </i>

                      <div slot="file"
                           slot-scope="{ file }">
                        <img class="el-upload-list__item-thumbnail"
                             :src="file.url"
                             alt="" />
                        <span class="el-upload-list__item-actions">
                          <!-- 图片的预览 -->
                          <span class="el-upload-list__item-preview"
                                @click="handlePictureCardPreview(file)">
                            <i class="el-icon-zoom-in"></i>
                          </span>
                          <!-- 图片的下载 -->
                          <span v-if="!disabled"
                                class="el-upload-list__item-delete"
                                @click="handleDownload(file)">
                            <i class="el-icon-download"></i>
                          </span>
                          <!-- 图片的移除 -->
                          <span v-if="!disabled"
                                class="el-upload-list__item-delete"
                                @click="handleRemove(file, 'idCardCopy')">
                            <i class="el-icon-delete"></i>
                          </span>
                        </span>
                      </div>
                    </el-upload>
                  </el-form-item>

                  <!-- 身份证反面 -->
                  <el-form-item label="身份证反面"
                                prop="idCardNational">
                    <el-upload action="#"
                               list-type="picture-card"
                               :limit="1"
                               :on-exceed="exceedFn"
                               :file-list="idCardNationalFileList"
                               ref="pictureUploadIdCardNational"
                               :on-change="
                        (file, fileList) =>
                          handleFileChange(file, fileList, 'idCardNational')
                      "
                               :auto-upload="false">
                      <i slot="default"
                         class="el-icon-download">
                        <div style="font-size: 14px; margin-top: 20px"
                             slot="default">点击上传</div>
                      </i>

                      <div slot="file"
                           slot-scope="{ file }">
                        <img class="el-upload-list__item-thumbnail"
                             :src="file.url"
                             alt="" />
                        <span class="el-upload-list__item-actions">
                          <!-- 图片的预览 -->
                          <span class="el-upload-list__item-preview"
                                @click="handlePictureCardPreview(file)">
                            <i class="el-icon-zoom-in"></i>
                          </span>
                          <!-- 图片的下载 -->
                          <span v-if="!disabled"
                                class="el-upload-list__item-delete"
                                @click="handleDownload(file)">
                            <i class="el-icon-download"></i>
                          </span>
                          <!-- 图片的移除 -->
                          <span v-if="!disabled"
                                class="el-upload-list__item-delete"
                                @click="handleRemove(file, 'idCardNational')">
                            <i class="el-icon-delete"></i>
                          </span>
                        </span>
                      </div>
                    </el-upload>
                  </el-form-item>
                  <el-form-item label="身份证居住地"
                                prop="idCardAddress"
                                v-if="selectIncomingTypeStatus !== 1">
                    <el-input placeholder="请输入身份证居住地"
                              v-model="wxSumbitForm.idCardAddress"></el-input>
                  </el-form-item>

                  <!-- 身份证的时间 -->
                  <el-form-item label="身份证的时间"
                                prop="IDCardDateRange"
                                v-if="selectIncomingTypeStatus !== 1">
                    <el-date-picker v-model="wxSumbitForm.IDCardDateRange"
                                    type="daterange"
                                    unlink-panels
                                    @change="IDCardDateRange"
                                    range-separator="至"
                                    start-placeholder="开始日期"
                                    end-placeholder="结束日期"
                                    format="yyyy-MM-dd"
                                    value-format="yyyy-MM-dd"
                                    class="ele-fluid" />
                  </el-form-item>
                </div>
              </div>
              <!-- 经营信息 -->
              <div v-if="selectIncomingTypeStatus == 0">
                <h6 class="hLabel">经营信息</h6>
                <el-form-item label="店铺名称"
                              prop="bizStoreName">
                  <el-input placeholder="请输入店铺名称"
                            v-model="wxSumbitForm.bizStoreName"></el-input>
                </el-form-item>
                <el-form-item label="详细地址"
                              prop="bizAddressCode">
                  <regions-select v-model="wxSumbitForm.bizAddressCode"
                                  placeholder="请选择省市区"
                                  @input="regionsInput" />
                </el-form-item>

                <el-form-item label="注册地址"
                              prop="bizStoreAddress">
                  <el-input placeholder="请输入注册地址"
                            v-model="wxSumbitForm.bizStoreAddress"></el-input>
                </el-form-item>
                <el-form-item label="客服电话"
                              prop="servicePhone">
                  <el-input placeholder="请输入客服电话"
                            v-model="wxSumbitForm.servicePhone"></el-input>
                </el-form-item>
                <el-form-item label="手机号"
                              prop="mobilePhone">
                  <el-input placeholder="请输入手机号"
                            v-model="wxSumbitForm.mobilePhone"></el-input>
                </el-form-item>
                <el-form-item label="电子邮箱"
                              prop="contactEmail">
                  <el-input placeholder="请输入电子邮箱"
                            v-model="wxSumbitForm.contactEmail"></el-input>
                </el-form-item>
              </div>
              <div v-if="selectIncomingTypeStatus == 1">
                <h6 class="hLabel">经营信息</h6>
                <el-form-item label="手机号"
                              prop="mobilePhone">
                  <el-input placeholder="请输入手机号"
                            v-model="wxSumbitForm.mobilePhone"></el-input>
                </el-form-item>
                <el-form-item label="电子邮箱"
                              prop="contactEmail">
                  <el-input placeholder="请输入电子邮箱"
                            v-model="wxSumbitForm.contactEmail"></el-input>
                </el-form-item>
              </div>

              <!-- 结算到支付宝 -->
              <div v-if="selectIncomingTypeStatus == 1">
                <!-- 结算到支付宝 -->
                <h6 class="hLabel">支付结算类型</h6>

                <div class="subjectTypeSwitch">
                  <!-- 个体 -->
                  <div :class="[
                      wxSumbitForm.defaultSettleType == 'bankCard'
                        ? 'individuality'
                        : 'active-individuality'
                    ]"
                       @click="switchSettlementType('bankCard')">银行卡</div>
                  <!-- 企业 -->
                  <div :class="[
                      wxSumbitForm.defaultSettleType == 'alipayAccount'
                        ? 'active-enterprise'
                        : 'enterprise'
                    ]"
                       @click="switchSettlementType('alipayAccount')">支付宝</div>
                </div>

                <div v-if="wxSumbitForm.defaultSettleType == 'alipayAccount'">
                  <h6 class="hLabel">结算到支付宝</h6>
                  <el-form-item label="支付宝号"
                                prop="alipayLogonId">
                    <el-input show-password
                              v-model="wxSumbitForm.alipayLogonId"></el-input>
                  </el-form-item>
                  <!-- <el-form-item label="抽佣比例"
                                prop="activitiesRate">
                    <el-input placeholder="请输入抽佣比例"
                              v-model="wxSumbitForm.activitiesRate">
                      <template slot="append">%</template></el-input>
                    <span>注意:【请认真分佣比例，最多不能超过30%!如不分佣，则不用填!一旦入驻成功，不支持修改分佣比例!】</span>
                  </el-form-item> -->
                </div>
              </div>
              <!-- 结算到银行卡 -->
              <div v-if="
                  selectIncomingTypeStatus == 0 ||
                  wxSumbitForm.defaultSettleType == 'bankCard'
                ">
                <h6 class="hLabel">结算到银行卡</h6>
                <el-form-item label="账户类型"
                              prop="bankAccountType">
                  <el-select v-model="wxSumbitForm.bankAccountType"
                             placeholder="请选择账户类型"
                             @change="verifyChangesFn">
                    <el-option v-for="item in bankAccountTypeOptions"
                               :key="item.value"
                               :label="item.label"
                               :value="item.value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="开户银行"
                              prop="accountBank">
                  <el-select v-model="wxSumbitForm.accountBank"
                             placeholder="请选择开户银行"
                             @change="accountBankFn">
                    <el-option v-for="item in accountBankOptions"
                               :key="item.value"
                               :label="item.label"
                               :value="item.value">
                    </el-option>
                  </el-select>
                  <div style="color: #b4b4b4">17家直连银行，请根据开户银行，非17家直连银行，该参数请填写为“其他银行”</div>
                </el-form-item>

                <div v-if="otherBanks">
                  <el-form-item label="开户银行全称"
                                prop="bankName">
                    <el-input placeholder="请输入开户银行全称"
                              v-model="wxSumbitForm.bankName"></el-input>
                  </el-form-item>
                  <el-form-item label="开户银行联行号"
                                prop="bankBranchId">
                    <el-input placeholder="请输入开户银行联行号"
                              v-model="wxSumbitForm.bankBranchId"
                              show-password></el-input>
                  </el-form-item>
                </div>

                <el-form-item label="开户的银行省"
                              prop="bankAddressCode">
                  <regions-select v-model="wxSumbitForm.bankAddressCode"
                                  placeholder="请选择省市区"
                                  @input="regionsInput" />
                </el-form-item>

                <el-form-item label="开户名称"
                              prop="accountName">
                  <el-input placeholder="请输入开户名称"
                            v-model="wxSumbitForm.accountName"></el-input>
                  <span>1、选择经营者个人银行卡时，开户名称必须与身份证姓名一致。<br />
                    2、选择对公账户时，开户名称必须与营业执照上的“商户名称”一致。</span>
                </el-form-item>
                <el-form-item label="银行账号"
                              prop="accountNumber">
                  <el-input placeholder="请输入银行账号"
                            v-model="wxSumbitForm.accountNumber"
                            show-password></el-input>
                </el-form-item>
                <!-- <el-form-item label="抽佣比例"
                              prop="activitiesRate">
                  <el-input placeholder="请输入抽佣比例"
                            v-model="wxSumbitForm.activitiesRate">
                    <template slot="append">%</template></el-input>
                  <span>注意:【请认真分佣比例，最多不能超过30%!如不分佣，则不用填!一旦入驻成功，不支持修改分佣比例!】</span>
                </el-form-item> -->
              </div>
              <div class="drawer__footer">
                <el-button @click="resetForm('wxSumbitForm')"
                           type="primary">重置</el-button>
                <el-button type="primary"
                           :loading="disable"
                           @click="submit('wxSumbitForm')">提交</el-button>
              </div>
            </el-form>
          </div>

          <el-form :label-position="labelPosition"
                   label-width="100px"
                   :rules="rules"
                   ref="zfbSumbitForm"
                   :model="zfbSumbitForm"
                   class="ruleForm">
            <div v-show="selectIncomingTypeStatus == 1 && incomingStatus == 1">
              <h6 class="hLabel">主体信息</h6>
              <el-form-item label="商户类型"
                            prop="merchantType">
                <div class="subjectTypeSwitch"
                     style="width: 300px">
                  <div :class="[
                      zfbSumbitForm.merchantType == '01'
                        ? 'individuality'
                        : 'active-individuality'
                    ]"
                       @click="switchType('01')">企业</div>

                  <div :class="[
                      zfbSumbitForm.merchantType == '06'
                        ? 'active-enterprise'
                        : 'enterprise'
                    ]"
                       @click="switchType('06')">个人商户</div>

                  <div :class="[
                      zfbSumbitForm.merchantType == '07'
                        ? 'active-enterprise'
                        : 'enterprise'
                    ]"
                       @click="switchType('07')">个体工商户</div>
                </div>
              </el-form-item>
              <el-form-item label="商户名称"
                            prop="name">
                <el-input v-model="zfbSumbitForm.name"
                          placeholder="请输入商户名称"></el-input>
                <span>注意:[支付宝的账单名称,会显示此处的设置的商户简称]</span>
              </el-form-item>
              <el-form-item label="商户别名"
                            prop="aliasName">
                <el-input v-model="zfbSumbitForm.aliasName"
                          placeholder="请输入商户别名"></el-input>
                <span>注意:[支付宝的账单名称,会显示此处的设置的商户简称]</span>
              </el-form-item>
              <el-form-item label="进件mcc"
                            prop="mcc">
                <el-cascader v-model="zfbSumbitForm.mcc"
                             placeholder="请填写进件mcc"
                             :options="mccOptions"
                             @change="handleChangeMcc"
                             :props="{ expandTrigger: 'hover' }"></el-cascader>
              </el-form-item>
              <el-form-item label="商户证件编号"
                            prop="certNo">
                <el-input v-model="zfbSumbitForm.certNo"
                          :placeholder="
                    zfbSumbitForm.merchantType !== '06'
                      ? '请选择营业执照号'
                      : '请选择个人身份证号码'
                  "></el-input>
                <span>按商户类型的说明提供对应的证件编号 如果为企业
                  个体工商户请输入营业执照号 个人商户的时候输入身份证号码</span>
              </el-form-item>

              <el-form-item label="营业执照名称"
                            prop="certName">
                <el-input v-model="zfbSumbitForm.certName"
                          placeholder="请输入营业执照名称"></el-input>
                <span>注意:[请填写营业执照的商家名称，2~110个字符,支持括号]</span>
              </el-form-item>

              <el-form-item label="营业执照省市区编号"
                            prop="licenseCode">
                <regions-select v-model="zfbSumbitForm.licenseCode"
                                placeholder="请营业执照省市区编号"
                                @input="(event) => regionsInput(event, 'licenseCode')" />
              </el-form-item>
              <el-form-item label="营业执照地址"
                            prop="address">
                <el-input v-model="zfbSumbitForm.address"
                          placeholder="请输入营业执照地址"></el-input>
              </el-form-item>

              <el-form-item label="门头照片"
                            prop="outDoorImages">
                <el-upload action="#"
                           ref="pictureUploadOutDoorImages"
                           list-type="picture-card"
                           :limit="5"
                           :on-exceed="exceedFn"
                           :on-change="
                    (files, fileList) =>
                      handleFileChange(files, fileList, 'outDoorImages')
                  "
                           :auto-upload="false">
                  <i slot="default"
                     class="el-icon-download">
                    <div style="font-size: 14px; margin-top: 20px"
                         slot="default">点击上传</div>
                  </i>

                  <div slot="file"
                       slot-scope="{ file }">
                    <img v-if="!isImageUrl"
                         class="el-upload-list__item-thumbnail"
                         :src="file.url"
                         alt="" />

                    <img v-if="isImageUrl"
                         class="el-upload-list__item-thumbnail"
                         :src="imageUrl"
                         alt="" />
                    <span class="el-upload-list__item-actions">
                      <span class="el-upload-list__item-preview"
                            @click="handlePictureCardPreview(file)">
                        <i class="el-icon-zoom-in"></i>
                      </span>

                      <span v-if="!disabled"
                            class="el-upload-list__item-delete"
                            @click="handleDownload(file)">
                        <i class="el-icon-download"></i>
                      </span>

                      <span v-if="!disabled"
                            class="el-upload-list__item-delete"
                            @click="handleRemove(file, 'outDoorImages')">
                        <i class="el-icon-delete"></i>
                      </span>
                    </span>
                  </div>
                </el-upload>

                <span>注意:【门头照片必须要要与营业执照的名称相关，否则人工审核会失败】</span>
              </el-form-item>

              <el-form-item label="办公环境"
                            prop="inDoorImages">
                <el-upload action="#"
                           ref="pictureUploadInDoorImages"
                           list-type="picture-card"
                           :limit="5"
                           :on-exceed="exceedFn"
                           :on-change="
                    (file, fileList) =>
                      handleFileChange(file, fileList, 'inDoorImages')
                  "
                           :auto-upload="false">
                  <i slot="default"
                     class="el-icon-download">
                    <div style="font-size: 14px; margin-top: 20px"
                         slot="default">点击上传</div>
                  </i>

                  <div slot="file"
                       slot-scope="{ file }">
                    <img class="el-upload-list__item-thumbnail"
                         :src="file.url"
                         alt="" />
                    <span class="el-upload-list__item-actions">
                      <span class="el-upload-list__item-preview"
                            @click="handlePictureCardPreview(file)">
                        <i class="el-icon-zoom-in"></i>
                      </span>

                      <span v-if="!disabled"
                            class="el-upload-list__item-delete"
                            @click="handleDownload(file)">
                        <i class="el-icon-download"></i>
                      </span>

                      <span v-if="!disabled"
                            class="el-upload-list__item-delete"
                            @click="handleRemove(file, 'inDoorImages')">
                        <i class="el-icon-delete"></i>
                      </span>
                    </span>
                  </div>
                </el-upload>

                <span>注意:【办公环境如:餐饮店的照片、办公室、公司前台等照片...】</span>
              </el-form-item>

              <div class="fromSubmitTwo">
                <h6 class="hLabel">法人/负责人信息</h6>

                <el-form-item label="法人姓名"
                              prop="legalName">
                  <el-input placeholder="请输入法人姓名"
                            v-model="zfbSumbitForm.legalName"
                            @change="inputFn"></el-input>
                </el-form-item>
                <el-form-item label="法人身份证号"
                              prop="legalCertNo">
                  <el-input placeholder="请输入法人身份证号"
                            v-model="zfbSumbitForm.legalCertNo"
                            show-password></el-input>
                </el-form-item>
                <el-form-item label="联系人姓名"
                              prop="contactName">
                  <el-input placeholder="请输入联系人姓名"
                            v-model="zfbSumbitForm.contactName"></el-input>
                </el-form-item>
                <el-form-item label="联系人电话"
                              prop="contactMobile">
                  <el-input placeholder="请输入联系人电话"
                            v-model="zfbSumbitForm.contactMobile"></el-input>
                </el-form-item>

                <div class="positiveAndNegativeIDcards">
                  <el-form-item label="身份证正面"
                                prop="certImage"
                                class="positiveIDcards">
                    <el-upload action="#"
                               ref="pictureUploadIdCertImage"
                               :limit="1"
                               :on-exceed="exceedFn"
                               :on-change="
                        (file, fileList) =>
                          handleFileChange(file, fileList, 'certImage')
                      "
                               list-type="picture-card"
                               :auto-upload="false">
                      <i slot="default"
                         class="el-icon-download">
                        <div style="font-size: 14px; margin-top: 20px"
                             slot="default">点击上传</div>
                      </i>

                      <div slot="file"
                           slot-scope="{ file }">
                        <img class="el-upload-list__item-thumbnail"
                             :src="file.url"
                             alt="" />
                        <span class="el-upload-list__item-actions">
                          <span class="el-upload-list__item-preview"
                                @click="handlePictureCardPreview(file)">
                            <i class="el-icon-zoom-in"></i>
                          </span>

                          <span v-if="!disabled"
                                class="el-upload-list__item-delete"
                                @click="handleDownload(file)">
                            <i class="el-icon-download"></i>
                          </span>

                          <span v-if="!disabled"
                                class="el-upload-list__item-delete"
                                @click="handleRemove(file, 'certImage')">
                            <i class="el-icon-delete"></i>
                          </span>
                        </span>
                      </div>
                    </el-upload>
                  </el-form-item>

                  <el-form-item label="身份证反面"
                                prop="certImageBack">
                    <el-upload action="#"
                               list-type="picture-card"
                               :limit="1"
                               :on-exceed="exceedFn"
                               ref="pictureUploadCertImageBack"
                               :on-change="
                        (file, fileList) =>
                          handleFileChange(file, fileList, 'certImageBack')
                      "
                               :auto-upload="false">
                      <i slot="default"
                         class="el-icon-download">
                        <div style="font-size: 14px; margin-top: 20px"
                             slot="default">点击上传</div>
                      </i>

                      <div slot="file"
                           slot-scope="{ file }">
                        <img class="el-upload-list__item-thumbnail"
                             :src="file.url"
                             alt="" />
                        <span class="el-upload-list__item-actions">
                          <span class="el-upload-list__item-preview"
                                @click="handlePictureCardPreview(file)">
                            <i class="el-icon-zoom-in"></i>
                          </span>

                          <span v-if="!disabled"
                                class="el-upload-list__item-delete"
                                @click="handleDownload(file)">
                            <i class="el-icon-download"></i>
                          </span>

                          <span v-if="!disabled"
                                class="el-upload-list__item-delete"
                                @click="handleRemove(file, 'certImageBack')">
                            <i class="el-icon-delete"></i>
                          </span>
                        </span>
                      </div>
                    </el-upload>
                  </el-form-item>
                </div>
              </div>

              <div v-if="selectIncomingTypeStatus == 1">
                <h6 class="hLabel">默认结算类型</h6>
                <div class="subjectTypeSwitch">
                  <div :class="[
                      zfbSumbitForm.defaultSettleType == 'bankCard'
                        ? 'individuality'
                        : 'active-individuality'
                    ]"
                       @click="switchSettlementType('bankCard')">银行卡</div>

                  <div :class="[
                      zfbSumbitForm.defaultSettleType == 'alipayAccount'
                        ? 'active-enterprise'
                        : 'enterprise'
                    ]"
                       @click="switchSettlementType('alipayAccount')">支付宝</div>
                </div>

                <div v-if="zfbSumbitForm.defaultSettleType == 'alipayAccount'">
                  <h6 class="hLabel">结算到支付宝</h6>
                  <el-form-item label="商户使用服务"
                                prop="serviceList">
                    <el-select v-model="zfbSumbitForm.serviceList"
                               multiple
                               @change="verifyChangesFn"
                               placeholder="请选择商户使用服务">
                      <el-option v-for="item in optionsServiceList"
                                 :key="item.value"
                                 :label="item.label"
                                 :value="item.value">
                      </el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="结算支付宝账号"
                                prop="alipayLogonId">
                    <el-input show-password
                              v-model="zfbSumbitForm.alipayLogonId"
                              placeholder="请输入结算支付宝账号"></el-input>
                  </el-form-item>
                  <el-form-item label="默认结算目标"
                                prop="defaultSettleTarget">
                    <el-input v-model="zfbSumbitForm.defaultSettleTarget"
                              show-password
                              :placeholder="
                        zfbSumbitForm.defaultSettleType == 'bankCard'
                          ? '请输入银行卡号'
                          : '请输入支付宝账号登录号'
                      "></el-input>
                  </el-form-item>
                  <el-form-item label="签约支付宝账户"
                                prop="bindingAlipayLogonId">
                    <el-input show-password
                              v-model="zfbSumbitForm.bindingAlipayLogonId"
                              placeholder="请输入签约支付宝账户"></el-input>
                  </el-form-item>
                </div>
              </div>

              <div v-if="
                  selectIncomingTypeStatus == 0 ||
                  zfbSumbitForm.defaultSettleType == 'bankCard'
                ">
                <h6 class="hLabel">结算到银行卡</h6>
                <el-form-item label="账户类型"
                              prop="usageType">
                  <el-select v-model="zfbSumbitForm.usageType"
                             placeholder="请选择账户类型"
                             @change="verifyChangesFn">
                    <el-option v-for="item in usageTypeOptions"
                               :key="item.value"
                               :label="item.label"
                               :value="item.value">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="银行卡类型"
                              prop="accountType">
                  <el-select v-model="zfbSumbitForm.accountType"
                             placeholder="请选择银行卡类型"
                             @change="verifyChangesFn">
                    <el-option v-for="item in accountTypeOptions"
                               :key="item.value"
                               :label="item.label"
                               :value="item.value">
                    </el-option>
                  </el-select>
                </el-form-item>

                <el-form-item label="默认结算目标"
                              prop="defaultSettleTarget">
                  <el-input show-password
                            v-model="zfbSumbitForm.defaultSettleTarget"
                            :placeholder="
                      zfbSumbitForm.defaultSettleType == 'bankCard'
                        ? '请输入银行卡号'
                        : '请输入支付宝账号登录号'
                    "></el-input>
                </el-form-item>
                <el-form-item label="开户银行"
                              prop="accountInstName">
                  <el-select v-model="zfbSumbitForm.accountInstName"
                             placeholder="请选择开户银行">
                    <el-option v-for="item in accountBankOptions"
                               :key="item.value"
                               :label="item.label"
                               :value="item.value">
                    </el-option>
                  </el-select>
                  <div style="color: #b4b4b4">17家直连银行，请根据开户银行，非17家直连银行，该参数请填写为“其他银行”</div>
                </el-form-item>
                <el-form-item label="开户行简称缩写"
                              prop="accountInstId">
                  <el-input v-model="zfbSumbitForm.accountInstId"
                            placeholder="请输入开户行简称缩写"></el-input>
                </el-form-item>
                <el-form-item label="开户支行名"
                              prop="accountBranchName">
                  <el-input placeholder="请输入开户支行名"
                            v-model="zfbSumbitForm.accountBranchName"></el-input>
                </el-form-item>

                <el-form-item label="开户行省市"
                              prop="accountInstCode">
                  <regions-select v-model="zfbSumbitForm.accountInstCode"
                                  placeholder="请选择省市区"
                                  @input="(event) => regionsInput(event, 'accountInstCode')" />
                </el-form-item>

                <el-form-item label="开户名称"
                              prop="accountHolderName">
                  <el-input placeholder="请输入开户名称"
                            v-model="zfbSumbitForm.accountHolderName"></el-input>
                  <span>1、选择经营者个人银行卡时，开户名称必须与身份证姓名一致。<br />
                    2、选择对公账户时，开户名称必须与营业执照上的“商户名称”一致。</span>
                </el-form-item>
                <el-form-item label="银行卡号"
                              prop="accountNo">
                  <el-input placeholder="请输入银行账号"
                            v-model="zfbSumbitForm.accountNo"
                            show-password></el-input>
                </el-form-item>
              </div>
              <div class="drawer__footer">
                <el-button @click="resetForm('zfbSumbitForm')"
                           type="primary">重置</el-button>
                <el-button type="primary"
                           @click="submit('zfbSumbitForm')">提交</el-button>
              </div>
            </div>
            <!-- 微信进件 -->
          </el-form>
        </div>
      </div>

      <!-- 商家进件 -->
      <el-row :gutter="10"
              v-if="incomingStatus != 1 && incomingStatus != 7"
              :style="{ height: rowActiveHight + 'px' }">
        <el-col v-bind="styleResponsive ? { lg: 24, md: 12 } : { span: 24 }">
          <!-- 查看详情 -->
          <el-drawer :visible.sync="drawer"
                     size="70%"
                     :before-close="handleClose"
                     ref="drawer"
                     :with-header="false">
            <div v-if="incomingStatus == incomingIndex && drawer">
              <incomingDetails :detailsList="detailsList"></incomingDetails>
            </div>
          </el-drawer>
          <!-- 进件审核中 -->

          <div class="fromSubmitThree"
               v-if="incomingStatus == 2">
            <img src="../../../static/examineing.png"
                 alt="" />
            <div class="examine">资料正在审核中</div>
            <div style="color: '#666'">预计需要1-7个工作日进行审核,请耐心等待~</div>
            <el-button class="closePage"
                       @click="viewDetail(2)"
                       round>查看详情</el-button>
          </div>

          <!-- 审核失败的 -->
          <div class="fromSubmitThree"
               v-if="incomingStatus == 3">
            <img src="../../../static/examineFail.png"
                 alt="" />
            <div class="examine"
                 style="color: #ff4d4f">进件失败</div>
            <div>{{ rejectReason }}</div>
            <!-- 重新提交状态走动 -->
            <div class="resubmit"
                 @click="restSubmit"
                 round>重新提交</div>
          </div>
          <!-- 待用户验证 -->

          <div class="fromSubmitThree"
               v-if="incomingStatus == 4">
            <img src="../../../static/examineing.png"
                 alt="" />
            <div class="examine">资料待用户验证</div>
            <div style="color: '#666'">资料待用户验证,请耐心等待~</div>
            <el-button class="closePage"
                       @click="viewDetail(4)"
                       round>查看详情</el-button>
          </div>
          <!-- 待签约 -->
          <div class="fromSubmitThree"
               v-if="incomingStatus == 5">
            <img src="../../../static/examineing.png"
                 alt="" />
            <div class="examine">资料待签约</div>
            <div style="color: '#666'">关注“微信支付商家助手”公众号后，公众号将自动发送签约消息</div>
            <div style="dispaly: flex">
              <el-button class="closePage"
                         @click="viewDetail(5)"
                         round>查看详情</el-button>
              <el-button class="closePage"
                         @click="followOfficialAccount"
                         round>打开页面进行关注</el-button>
            </div>
          </div>
          <!-- 开通权限中 -->
          <div class="fromSubmitThree"
               v-if="incomingStatus == 6">
            <img src="../../../static/examineing.png"
                 alt="" />
            <div class="examine">开通权限中</div>
            <div style="color: '#666'">开通权限中,请耐心等待~</div>
            <el-button class="closePage"
                       @click="viewDetail(6)"
                       round>查看详情</el-button>
          </div>
          <!-- 已经作废 -->
          <div class="fromSubmitThree"
               v-if="incomingStatus == 8">
            <img src="../../../static/examineFail.png"
                 alt="" />
            <div class="examine"
                 style="color: #ff4d4f">已经作废</div>
            <div>进件作废 申请已经取消~</div>
            <!-- 重新提交状态走动 -->
            <div class="resubmit"
                 @click="viewDetail(8)"
                 round>查看详情</div>
          </div>
          <!-- 该商家没有进件信息 -->
          <div class="fromSubmitThree"
               v-if="incomingStatus == 9">
            <img src="../../../static/examineFail.png"
                 alt="" />
            <div class="examine"
                 style="color: #ff4d4f">查询失败</div>
            <div>该商家没有进件信息~</div>
            <!-- 重新提交状态走动 -->
          </div>
          <!--  -->
          <ele-modal width="600px"
                     height="300px"
                     title="签约提示"
                     :visible.sync="visibleModal"
                     :maxable="true">
            <!-- class="SigningReminder" -->
            <div style="padding: 0px 0px 10 0; line-height: 18px">
              <h6>1、超级管理员用微信扫码，关注“微信支付商家助手”公众号后，公众号将自动发送签约消息；超管需点击消息，根据指引完成核对联系信息、账户验证、签约等操作</h6>
              <h6>2、超管完成核对联系信息，后续申请单进度可通过公众号自动通知超级管理员。</h6>
              <div style="text-align: center">
                <img alt=""
                     :src="signUrl"
                     style="width: 216px; height: 250px" />
              </div>
            </div>

            <span slot="footer"
                  class="dialog-footer">
              <el-button @click="visibleModal = false">取 消</el-button>
              <el-button type="primary"
                         @click="visibleModal = false">确 定</el-button>
            </span>
          </ele-modal>
        </el-col>
      </el-row>
    </el-card>

    <UserEdit :visible.sync="showEdit"
              :data="current"></UserEdit>
    <el-dialog :visible.sync="dialogVisible">
      <img width="100%"
           :src="dialogImageUrl"
           alt="" />
    </el-dialog>
  </div>
</template>

<script>
import { getToken } from '@/utils/token-util';
import { userOssSignature } from '@/api/creatCenter/material';
import UserSearch from './components/user-search.vue';
import UserEdit from './components/user-edit.vue';
import UserImport from './components/user-import.vue';
import EquipmentEdit from './components/equipment-edit.vue';
import RegionsSelect from '@/components/RegionsSelect/index.vue';
import { getRegionLabel } from 'ele-admin/packages/utils/regions';
import incomingDetails from './components/incomingDetails.vue';
import {
  wxGetUploadMediaId,
  wxSumbitMerchantApplyFor,
  zfbGetUploadMediaId,
  zfbMerchantCreate,
  wechatpayGenerate,
  selectByPrimaryKey
} from '@/api/douApi';
import {
  pageMerchant,
  removeUsers,
  updateUserStatus,
  resetPassword,
  updateUserPassword,
  pageAgencyType
} from '@/api/oem';
import {
  certTypeList,
  mccOptions,
  optionsServiceList,
  qualificationTypeOptions,
  accountBankOptions,
  bankAccountTypeOptions,
  usageTypeOptions,
  accountTypeOptions,
  rules,
  list,
  idDocTypeOptions,
  wxSumbitForm,
  validateLogo,
  storeEntrancePicLogo,
  indoorPicLogo,
  idCardCopyLogo,
  idCardNationalLogo,
  qualificationsLogo,
  outDoorImagesLogo,
  inDoorImagesLogo,
  certImageLogo,
  certImageBackLogo,
  zfbSumbitForm
} from './constant/constant';
import { JSEncrypt } from 'jsencrypt';
// 导入组件
import { getDianShu } from '@/api/system/user';
import ElImageViewer from 'element-ui/packages/image/src/image-viewer';
import Steps from '@/components/Steps/Steps.vue';
import axios from 'axios';
export default {
  name: 'SystemUser',
  components: {
    incomingDetails,
    UserSearch,
    EquipmentEdit,
    UserEdit,
    UserImport,
    ElImageViewer,
    Steps,
    RegionsSelect
  },
  data () {
    validateLogo;
    storeEntrancePicLogo,
      indoorPicLogo,
      idCardCopyLogo,
      idCardNationalLogo,
      qualificationsLogo,
      outDoorImagesLogo,
      inDoorImagesLogo,
      certImageLogo,
      certImageBackLogo;
    return {
      wxSumbitForm,
      certTypeList,
      mccOptions,
      optionsServiceList,
      qualificationTypeOptions,
      accountBankOptions,
      bankAccountTypeOptions,
      usageTypeOptions,
      accountTypeOptions,
      rules,
      list,
      idDocTypeOptions,
      zfbSumbitForm,
      windowHeight: document.documentElement.clientHeight - 110,
      rowActiveHight: document.documentElement.clientHeight - 160,

      // 当前编辑数据
      current: null,
      // 是否显示编辑弹窗
      showEdit: false,
      // 当被限制显示最新的图片
      isImageUrl: false,
      imageUrl: '',
      dialogImageUrl: '',
      //   查看详情列表
      detailsList: [],
      disabled: false,
      // 是否弹框
      drawer: false,
      // 代理类型list
      typeList: [],
      // 表格选中数据
      selection: [],
      // 当前编辑数据
      current: null,
      // 是否显示编辑弹窗
      showEdit: false,
      // 是否显示导入弹窗
      showImport: false,
      //是否显示划拨编辑弹窗
      showTransfer: false,
      showViewer: false, // 显示查看器

      // 状态 1 为 微信 2 为支付宝 3为查看详情
      jjstatus: '',

      //   labelPosition right/left/top

      labelPosition: 'top',
      //图片数量
      listLength: 0,
      // 图片文件列表
      fileList: [],

      // 图片列表
      pictureList: [],

      // 签约弹框
      visibleModal: false,

      //   选择进件类型 0为微信 1 为支付宝
      selectIncomingTypeStatus: 0,
      //   进件类型 0为微信 1 为支付宝
      incomingTypeStatus: 0,

      // 判断当前是否已经进件 1未进件 2 微信进件 3 支付宝进件 4.重新提交
      IncomingOrNot: 1,
      //  图片弹框
      dialogVisible: false,

      // 是否显示开户银行联合号 和开户银行全称
      otherBanks: false,

      //   加载中
      loading: false,
      // 微信存储的图片
      wxPictureArr: [],
      // 支付宝存储的图片
      zfbPictureArr: [],
      disable: false,
      // 判断当前 状态 1 为 未进件 2 为 进件中 3进件失败 4 进件成功代签约 5 进件成功
      incomingStatus: '',
      // 查看详情索引
      incomingIndex: '',
      //   签约二维码
      signUrl: '',
      //   驳回原因
      rejectReason: '',
      loadingResubmit: false,
      //  驳回需要传的id
      resubmitId: {},
      //   营业执照图片列表
      licenseCopyFileList: [],
      //  门头照片图片列表
      storeEntrancePicFileList: [],
      //   办公环境图片列表
      indoorPicFileList: [],
      // 特殊资质图片列表
      qualificationsFileList: [],
      // 正面身份证图片列表
      idCardCopyFileList: [],
      // 反面身份证图片列表
      idCardNationalFileList: [],
      //   这里需要定义一个状态 如果在重新提交的时候删除了或者删除了需要改变状态默认为false
      restSubmitStatus: false,
      //  驳回数据回显
      rejectReasonObject: {}
    };
  },

  mounted () {
    // 查询可用点数
    getDianShu({
      id: this.$store.state.user.info.merchantId
    })
      .then((msg) => {
        console.log('msg', msg);
        if (msg) {
          this.wxSumbitForm.merchantId =
            this.$store.state.user.info.merchantId;
          this.wxSumbitForm.subordinateAgent = msg.oemId;
        }
      })
      .catch((e) => {
        this.$message.error(e.message);
      });
  },

  // 路由刷新
  async activated () {
    this.init();
  },
  created () {
    this.initRules();
  },
  computed: {
    // 是否开启响应式布局
    styleResponsive () {
      return this.$store.state.theme.styleResponsive;
    },
    classAlipayAccount () {
      return {
        'active-enterprise':
          this.zfbSumbitForm.defaultSettleType === 'alipayAccount',
        enterprise: this.zfbSumbitForm.defaultSettleType !== 'alipayAccount'
      };
    },
    certNoPattern () {
      return this.zfbSumbitForm?.merchantType !== '06'
        ? /^[A-Z0-9]{18}$/
        : /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
    },
    certNoMessage () {
      return this.zfbSumbitForm?.merchantType !== '06'
        ? '营业执照上的注册号/统一社会信用代码格式不对'
        : '身份证输入不合法';
    },
    IncomingStatus () {
      return function (index) {
        if (index == 1) {
          return '未进件';
        } else if (index == 2) {
          return '微信进件';
        } else if (index == 3) {
          return '支付宝进件';
        } else if (index == 4) {
          return '重新进件';
        }
      };
    },
    customStyle () {
      return {
        color: this.IncomingOrNot == 4 ? 'red' : ''
      };
    }
  },

  methods: {
    // 查看详情页面
    async viewDetail (index) {
      console.log(list);
      if (index == 2) {
        // 再次加载获取到值
        this.init();
      }
      this.drawer = true;
      this.incomingIndex = index;
    },
    // 图片进行请求获取到mediaId

    async wxGetUploadMediaIdFn (url, imgType, extractedString) {
      const result = await wxGetUploadMediaId([url]);
      if (result.data.code == 200) {
        if (imgType == 'licenseCopy') {
          // 营业执照照片
          this.wxSumbitForm.licenseCopyMediaId = [
            { id: result.data.data.mediaId, picName: extractedString }
          ];
          console.log(this.wxSumbitForm.licenseCopyMediaId);
        } else if (imgType == 'storeEntrancePic') {
          // 门头照片
          console.log(this.wxSumbitForm.storeEntrancePicMediaId);
          this.wxSumbitForm.storeEntrancePicMediaId.push({
            id: result.data.data.mediaId,
            picName: extractedString
          });
        } else if (imgType == 'indoorPic') {
          // 办公环境
          this.wxSumbitForm.indoorPicMediaId.push({
            id: result.data.data.mediaId,
            picName: extractedString
          });
        } else if (imgType == 'qualifications') {
          // 特殊资历
          this.wxSumbitForm.qualificationsMediaId.push({
            id: result.data.data.mediaId,
            picName: extractedString
          });
        } else if (imgType == 'idCardCopy') {
          // 正面身份证头像
          this.wxSumbitForm.idCardCopyMediaId = [
            { id: result.data.data.mediaId, picName: extractedString }
          ];
        } else if (imgType == 'idCardNational') {
          // 反面身份证头像
          this.wxSumbitForm.idCardNationalMediaId = [
            { id: result.data.data.mediaId, picName: extractedString }
          ];
          this.loadingResubmit = false;
        }

        this.disabled = false;
      }
    },
    findMatchingProperties (obj1, echoFromObj) {
      this.loadingResubmit = true;
      setTimeout(() => {

        console.log(obj1, echoFromObj);
        for (const prop in echoFromObj) {
          if (obj1.hasOwnProperty(prop)) {
            echoFromObj[prop] = obj1[prop];
          }
        }
        console.log(echoFromObj);

        this.wxSumbitForm = echoFromObj;
        if (this.wxSumbitForm.periodEnd == '长期') {
          // 如果长期有效赋值为'' 提交有进行判断
          this.wxSumbitForm.periodEnd = '',
            this.wxSumbitForm.checked = true

        }
        this.wxSumbitForm.IDCardDateRange.push(echoFromObj.cardPeriodBegin);
        this.wxSumbitForm.IDCardDateRange.push(echoFromObj.cardPeriodEnd);
        (this.wxSumbitForm.qualificationsMediaId = []),
          (this.wxSumbitForm.storeEntrancePicMediaId = []),
          (this.wxSumbitForm.indoorPicMediaId = []);
        this.wxSumbitForm.licenseCopyMediaId = '';
        this.wxSumbitForm.idCardCopyMediaId = '';
        this.wxSumbitForm.idCardNationalMediaId = '';
        console.log(
          echoFromObj.licenseCopy,
          echoFromObj.storeEntrancePic,
          echoFromObj.indoorPic,
          echoFromObj.qualifications,
          echoFromObj.idCardCopy,
          echoFromObj.idCardNational
        );

        // 第一步 获取到每个类型有几张图片 然后变成数组 添加到不同类型的ref实例里面进行展示
        // 营业执照
        const licenseCopyArr = echoFromObj.licenseCopy.split(',');
        licenseCopyArr.forEach((url) => {
          const extractedString = this.regexPicType(url);
          console.log(extractedString);
          this.licenseCopyFileList.push({ name: extractedString, url: url });
          this.wxGetUploadMediaIdFn(url, 'licenseCopy', extractedString);
          //
        });
        // 门头照片
        const storeEntrancePic = echoFromObj.storeEntrancePic.split(',');
        storeEntrancePic.forEach((url) => {
          const extractedString = this.regexPicType(url);
          console.log(extractedString);
          this.storeEntrancePicFileList.push({
            name: extractedString,
            url: url
          });
          this.wxGetUploadMediaIdFn(url, 'storeEntrancePic', extractedString);
        });
        // 办公环境
        const indoorPic = echoFromObj.indoorPic.split(',');
        indoorPic.forEach((url) => {
          const extractedString = this.regexPicType(url);
          console.log(extractedString);
          this.indoorPicFileList.push({ name: extractedString, url: url });
          this.wxGetUploadMediaIdFn(url, 'indoorPic', extractedString);
        });
        // 特殊资历
        if (echoFromObj.qualifications) {
          const qualifications = echoFromObj.qualifications.split(',');
          console.log(qualifications);
          if (qualifications.length) {
            qualifications.forEach((url) => {
              const extractedString = this.regexPicType(url);
              console.log(extractedString);
              this.qualificationsFileList.push({
                name: extractedString,
                url: url
              });
              this.wxGetUploadMediaIdFn(
                url,
                'qualifications',
                extractedString
              );
            });
          }
        }

        // 正面身份证上传
        const idCardCopy = echoFromObj.idCardCopy.split(',');
        idCardCopy.forEach((url) => {
          const extractedString = this.regexPicType(url);
          console.log(extractedString);
          this.idCardCopyFileList.push({ name: extractedString, url: url });
          this.wxGetUploadMediaIdFn(url, 'idCardCopy', extractedString);
        });
        // 反面身份证上传
        const idCardNational = echoFromObj.idCardNational.split(',');
        idCardNational.forEach((url) => {
          const extractedString = this.regexPicType(url);
          console.log(extractedString);
          this.idCardNationalFileList.push({
            name: extractedString,
            url: url
          });
          console.log(this.idCardNationalFileList);
          this.wxGetUploadMediaIdFn(url, 'idCardNational', extractedString);
        });

      }, 500);
    },

    // 正则匹配上传图片类型
    regexPicType (imageString) {
      const regex = /com\/(.+)/;
      const match = imageString.match(regex);

      if (match && match.length > 1) {
        const extractedString = match[1];
        // const str = this.regexType(extractedString)
        return extractedString;
      } else {
        console.log('未找到匹配的字符串');
      }
    },
    // 重新提交
    restSubmit () {



      this.incomingStatus = 1;

      this.findMatchingProperties(this.rejectReasonObject, this.wxSumbitForm);
      console.log(this.idCardNationalFileList);
    },
    followOfficialAccount () {
      this.visibleModal = !this.visibleModal;
    },
    handleClose (done) {
      this.$confirm('是否要返回支付进件页面？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then((_) => {
          done();
        })
        .catch((_) => { });
    },
    initRules () {
      console.log(this.zfbSumbitForm.merchantType);
      this.$set(this.rules, 'certNo', [
        { required: true, message: '请填写商户证件编号', trigger: 'blur' },
        {
          pattern:
            this.zfbSumbitForm.merchantType !== '06'
              ? /^[A-Z0-9]{18}$/
              : /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
          message:
            this.zfbSumbitForm.merchantType !== '06'
              ? '营业执照上的注册号/统一社会信用代码格式不对'
              : '身份证输入不合法'
        }
      ]);

      this.$set(this.rules, 'defaultSettleTarget', [
        { required: true, message: '请填写商户证件编号', trigger: 'blur' },
        {
          pattern:
            this.zfbSumbitForm.defaultSettleType == 'bankCard'
              ? /^([1-9])(\d{15}|\d{16}|\d{17}|\d{18})$/
              : /^[a-zA-Z0-9][a-zA-Z0-9._]{4,18}[a-zA-Z0-9]$/,
          message:
            this.zfbSumbitForm.defaultSettleType == 'bankCard'
              ? '请输入银行卡号'
              : '请输入支付宝账号登录号'
        }
      ]);
    },
    // mcc
    handleChangeMcc (value) {
      if (this.zfbSumbitForm.mcc.length) {
        this.$refs.zfbSumbitForm.clearValidate('mcc');
      }
      console.log(value[1]);
    },
    // 切换进件结算类型
    switchSettlementType (settlementType) {
      console.log(settlementType);
      this.zfbSumbitForm.defaultSettleType = settlementType;
      this.initRules();
      this.zfbSumbitForm.defaultSettleTarget = '';
    },
    // 勾选 有效期 那么periodEnd变为长期
    switchCheckbox (checked) {
      this.wxSumbitForm.checked = checked;
      // 如果勾选 那么营业结束时间变为长期
      if (checked) {
        this.wxSumbitForm.periodEnd = '';
        // 取消校验
        this.$refs.wxSumbitForm.clearValidate('periodEnd');
      } else {
        this.wxSumbitForm.periodEnd = '';
      }
    },
    // 图片的预览
    handlePictureCardPreview (file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = !this.dialogVisible;
    },

    handleRemove (file, removeName) {
      let uploadFiles;
      // 进行判断 对不同的数据进行不同的图片的删除
      if (!this.rejectReason) {
        if (removeName == 'licenseCopy') {
          uploadFiles = this.$refs.pictureUploadLicenseCopy.uploadFiles;
        } else if (removeName == 'storeEntrancePic') {
          uploadFiles = this.$refs.pictureUploadStoreEntrancePic.uploadFiles;
        } else if (removeName == 'indoorPic') {
          uploadFiles = this.$refs.pictureUploadIndoorPic.uploadFiles;
        } else if (removeName == 'qualifications') {
          uploadFiles = this.$refs.pictureUploadQualifications.uploadFiles;
        } else if (removeName == 'idCardCopy') {
          uploadFiles = this.$refs.pictureUploadIdCardCopy.uploadFiles;
        } else if (removeName == 'idCardNational') {
          uploadFiles = this.$refs.pictureUploadIdCardNational.uploadFiles;
        } else if (removeName == 'outDoorImages') {
          uploadFiles = this.$refs.pictureUploadOutDoorImages.uploadFiles;
        } else if (removeName == 'inDoorImages') {
          uploadFiles = this.$refs.pictureUploadInDoorImages.uploadFiles;
        } else if (removeName == 'certImage') {
          uploadFiles = this.$refs.pictureUploadIdCertImage.uploadFiles;
        } else if (removeName == 'certImageBack') {
          uploadFiles = this.$refs.pictureUploadIdCertImageBack.uploadFiles;
        }

        console.log(this.fileList, file.uid);
        // 获取到该图片的uid 去  this.fileList 去匹配到uid 找到然后去删除掉
        if (this.fileList.length) {
          const uidIndex = this.fileList.findIndex((item, index) => {
            return item.uid == file.uid;
          });
          console.log(uidIndex);
          if (uidIndex !== -1) {
            this.fileList.splice(uidIndex, 1);
          }
          console.log(this.fileList, file.uid);
        }
        for (let i = 0; i < uploadFiles.length; i++) {
          if (uploadFiles[i]['url'] == file.url) {
            uploadFiles.splice(i, 1);
          }
        }

        // 需要把对应上传的图片和 和id 需要删除

        if (this.selectIncomingTypeStatus == 0) {
          const picIndex = this.wxPictureArr.findIndex((item) => {
            return item.uid == file.raw.uid;
          });

          this.wxPictureArr.splice(picIndex, 1);
        } else {
          const picIndex = this.zfbPictureArr.findIndex((item) => {
            return item.uid == file.raw.uid;
          });

          this.zfbPictureArr.splice(picIndex, 1);
        }

        if (removeName == 'licenseCopy') {
          const mediaIdIndex = this.wxSumbitForm.licenseCopyMediaId.findIndex(
            (item) => {
              return item.uid == file.uid;
            }
          );
          this.wxSumbitForm.licenseCopyMediaId.splice(mediaIdIndex, 1);
        } else if (removeName == 'storeEntrancePic') {
          const mediaIdIndex =
            this.wxSumbitForm.storeEntrancePicMediaId.findIndex((item) => {
              return item.uid == file.uid;
            });
          this.wxSumbitForm.storeEntrancePicMediaId.splice(mediaIdIndex, 1);
        } else if (removeName == 'qualifications') {
          const mediaIdIndex =
            this.wxSumbitForm.qualificationsMediaId.findIndex((item) => {
              return item.uid == file.uid;
            });
          this.wxSumbitForm.qualificationsMediaId.splice(mediaIdIndex, 1);
        } else if (removeName == 'idCardCopy') {
          const mediaIdIndex = this.wxSumbitForm.idCardCopyMediaId.findIndex(
            (item) => {
              return item.uid == file.uid;
            }
          );
          this.wxSumbitForm.idCardCopyMediaId.splice(mediaIdIndex, 1);
        } else if (removeName == 'indoorPic') {
          const mediaIdIndex = this.wxSumbitForm.indoorPicMediaId.findIndex(
            (item) => {
              return item.uid == file.uid;
            }
          );
          this.wxSumbitForm.indoorPicMediaId.splice(mediaIdIndex, 1);
        } else if (removeName == 'idCardNational') {
          const mediaIdIndex =
            this.wxSumbitForm.idCardNationalMediaId.findIndex((item) => {
              return item.uid == file.uid;
            });
          this.wxSumbitForm.idCardNationalMediaId.splice(mediaIdIndex, 1);
        } else if (removeName == 'outDoorImages') {
          const mediaIdIndex =
            this.zfbSumbitForm.outDoorImagesOssKey.findIndex((item) => {
              return item.uid == file.uid;
            });
          this.zfbSumbitForm.outDoorImagesOssKey.splice(mediaIdIndex, 1);
        } else if (removeName == 'inDoorImages') {
          const mediaIdIndex =
            this.zfbSumbitForm.inDoorImagesOssKey.findIndex((item) => {
              return item.uid == file.uid;
            });
          this.zfbSumbitForm.inDoorImagesOssKey.splice(mediaIdIndex, 1);
        } else if (removeName == 'certImage') {
          const mediaIdIndex = this.zfbSumbitForm.certImageOssKey.findIndex(
            (item) => {
              return item.uid == file.uid;
            }
          );
          this.zfbSumbitForm.certImageOssKey.splice(mediaIdIndex, 1);
        } else if (removeName == 'certImageBack') {
          const mediaIdIndex =
            this.zfbSumbitForm.certImageBackOssKey.findIndex((item) => {
              return item.uid == file.uid;
            });
          this.zfbSumbitForm.certImageBackOssKey.splice(mediaIdIndex, 1);
        }

        if (this.selectIncomingTypeStatus == 0) {
          this.wxSumbitFilter();
        } else {
          this.zfbSumbitFilter();
        }
      } else {
        uploadFiles = this.$refs.pictureUploadLicenseCopy.uploadFiles;
        console.log(file, removeName, uploadFiles);
        // 清除图片 清除mediaId
        // 进行判断 对不同的数据进行不同的图片的删除
        if (removeName == 'licenseCopy') {
          uploadFiles = this.$refs.pictureUploadLicenseCopy.uploadFiles;
          //   删除展示的图片
          for (let i = 0; i < uploadFiles.length; i++) {
            if (uploadFiles[i]['url'] == file.url) {
              uploadFiles.splice(i, 1);
            }
          }
          //   删除sumbitFrom 的图片
          const licenseCopyImg = this.wxSumbitForm.licenseCopy.split(',');
          licenseCopyImg.forEach((item, i) => {
            if (item == file.url) {
              licenseCopyImg.splice(i, 1);
              this.wxSumbitForm.licenseCopy = licenseCopyImg.join();
            }
          });
          // 删除MediaId的图片
          const mediaIdIndex = this.wxSumbitForm.indoorPicMediaId.findIndex(
            (item) => {
              return item.picName == file.name;
            }
          );
          this.wxSumbitForm.indoorPicMediaId.splice(mediaIdIndex, 1);
        } else if (removeName == 'storeEntrancePic') {
          uploadFiles = this.$refs.pictureUploadStoreEntrancePic.uploadFiles;
          //   删除展示的图片
          for (let i = 0; i < uploadFiles.length; i++) {
            if (uploadFiles[i]['url'] == file.url) {
              uploadFiles.splice(i, 1);
            }
          }
          //   删除sumbitFrom 的图片
          const storeEntrancePicImg =
            this.wxSumbitForm.storeEntrancePic.split(',');
          storeEntrancePicImg.forEach((item, i) => {
            if (item == file.url) {
              storeEntrancePicImg.splice(i, 1);
              this.wxSumbitForm.storeEntrancePic = storeEntrancePicImg.join();
            }
          });
          // 删除MediaId的图片
          const mediaIdIndex =
            this.wxSumbitForm.storeEntrancePicMediaId.findIndex((item) => {
              return item.picName == file.name;
            });
          this.wxSumbitForm.storeEntrancePicMediaId.splice(mediaIdIndex, 1);
        } else if (removeName == 'indoorPic') {
          uploadFiles = this.$refs.pictureUploadIndoorPic.uploadFiles;
          //   删除展示的图片
          for (let i = 0; i < uploadFiles.length; i++) {
            if (uploadFiles[i]['url'] == file.url) {
              uploadFiles.splice(i, 1);
            }
          }
          //   删除sumbitFrom 的图片
          const indoorPicImg = this.wxSumbitForm.indoorPic.split(',');
          indoorPicImg.forEach((item, i) => {
            if (item == file.url) {
              indoorPicImg.splice(i, 1);
              this.wxSumbitForm.indoorPic = indoorPicImg.join();
            }
          });
          // 删除MediaId的图片
          const mediaIdIndex = this.wxSumbitForm.indoorPicMediaId.findIndex(
            (item) => {
              return item.picName == file.name;
            }
          );
          this.wxSumbitForm.indoorPicMediaId.splice(mediaIdIndex, 1);
        } else if (removeName == 'qualifications') {
          uploadFiles = this.$refs.pictureUploadQualifications.uploadFiles;
          //   删除展示的图片
          for (let i = 0; i < uploadFiles.length; i++) {
            if (uploadFiles[i]['url'] == file.url) {
              uploadFiles.splice(i, 1);
            }
          }
          //   删除sumbitFrom 的图片
          const qualificationsImg =
            this.wxSumbitForm.qualifications.split(',');
          qualificationsImg.forEach((item, i) => {
            if (item == file.url) {
              qualificationsImg.splice(i, 1);
              this.wxSumbitForm.qualifications = qualificationsImg.join();
            }
          });
          // 删除MediaId的图片
          const mediaIdIndex =
            this.wxSumbitForm.qualificationsMediaId.findIndex((item) => {
              return item.picName == file.name;
            });
          this.wxSumbitForm.qualificationsMediaId.splice(mediaIdIndex, 1);
        } else if (removeName == 'idCardCopy') {
          uploadFiles = this.$refs.pictureUploadIdCardCopy.uploadFiles;
          //   删除展示的图片
          for (let i = 0; i < uploadFiles.length; i++) {
            if (uploadFiles[i]['url'] == file.url) {
              uploadFiles.splice(i, 1);
            }
          }
          //   删除sumbitFrom 的图片
          const idCardCopyImg = this.wxSumbitForm.idCardCopy.split(',');
          idCardCopyImg.forEach((item, i) => {
            if (item == file.url) {
              idCardCopyImg.splice(i, 1);
              this.wxSumbitForm.idCardCopy = idCardCopyImg.join();
            }
          });
          // 删除MediaId的图片
          const mediaIdIndex = this.wxSumbitForm.idCardCopyMediaId.findIndex(
            (item) => {
              return item.picName == file.name;
            }
          );
          this.wxSumbitForm.idCardCopyMediaId.splice(mediaIdIndex, 1);
        } else if (removeName == 'idCardNational') {
          uploadFiles = this.$refs.pictureUploadIdCardNational.uploadFiles;
          //   删除展示的图片
          for (let i = 0; i < uploadFiles.length; i++) {
            if (uploadFiles[i]['url'] == file.url) {
              uploadFiles.splice(i, 1);
            }
          }
          //   删除sumbitFrom 的图片
          const idCardNationalImg =
            this.wxSumbitForm.idCardNational.split(',');
          idCardNationalImg.forEach((item, i) => {
            if (item == file.url) {
              idCardNationalImg.splice(i, 1);
              this.wxSumbitForm.idCardNational = idCardNationalImg.join();
            }
          });
          // 删除MediaId的图片
          const mediaIdIndex =
            this.wxSumbitForm.idCardNationalMediaId.findIndex((item) => {
              return item.picName == file.name;
            });
          this.wxSumbitForm.idCardNationalMediaId.splice(mediaIdIndex, 1);
        }
      }
    },

    // 图片的下载

    handleDownload (file) {
      window.open(file.url);
    },

    verifyChangesFn (e, name) {
      console.log(e, this.wxSumbitForm.qualificationType);

      if (name == 'qualificationType') {
        // 这里获取到数组进行筛选

        const selectValue = this.qualificationTypeOptions.filter((item) => {
          return item.label == e;
        });
        // 如果当前是个人
        if (this.wxSumbitForm.subjectType == 'SUBJECT_TYPE_INDIVIDUAL') {
          this.wxSumbitForm.settlementId = selectValue[0].personSettlementId;
        } else {
          this.wxSumbitForm.settlementId =
            selectValue[0].enterpriseSettlementId;
        }
        console.log(selectValue, this.wxSumbitForm.settlementId);
      }

      if (this.wxSumbitForm.qualificationType) {
        this.$refs.wxSumbitForm.clearValidate('qualificationType');
      }
      if (this.wxSumbitForm.idDocType) {
        this.$refs.wxSumbitForm.clearValidate('idDocType');
      }
      if (this.wxSumbitForm.bankAccountType) {
        this.$refs.wxSumbitForm.clearValidate('bankAccountType');
      }
      if (this.zfbSumbitForm.usageType) {
        this.$refs.zfbSumbitForm.clearValidate('usageType');
      }
      if (this.wxSumbitForm.accountType) {
        this.$refs.wxSumbitForm.clearValidate('accountType');
      }
      if (this.zfbSumbitForm.serviceList) {
        this.$refs.wxSumbitForm.clearValidate('serviceList');
      }
    },
    inputFn (e) {
      this.wxSumbitForm.idCardName = e;
      console.log(e);
    },

    // 清除城市的校验
    regionsInput (value, nameCode) {
      console.log(value, '==============', nameCode);
      if (nameCode == 'licenseCode') {
        this.zfbSumbitForm.provinceCode = value[0];
        this.zfbSumbitForm.cityCode = value[1];
        this.zfbSumbitForm.districtCode = value[2];
      }
      if (nameCode == 'accountInstCode') {
        console.log(getRegionLabel(value));
        const regionLabel = getRegionLabel(value);
        // 开户行所在的省
        this.zfbSumbitForm.accountInstProvince = regionLabel[0];
        // 开户行所在的市
        this.zfbSumbitForm.accountInstCity = regionLabel[1];
      }
      if (this.wxSumbitForm.bizAddressCode.length) {
        this.$refs.wxSumbitForm.clearValidate('bizAddressCode');
      }
      if (this.wxSumbitForm.bankAddressCode.length) {
        this.$refs.wxSumbitForm.clearValidate('bankAddressCode');
      }
      if (this.zfbSumbitForm.districtCode.length) {
        this.$refs.zfbSumbitForm.clearValidate('districtCode');
      }
      if (this.zfbSumbitForm.licenseCode.length) {
        this.$refs.zfbSumbitForm.clearValidate('licenseCode');
      }
      if (this.zfbSumbitForm.accountInstCode.length) {
        this.$refs.zfbSumbitForm.clearValidate('accountInstCode');
      }
    },

    accountBankFn (item) {
      if (this.wxSumbitForm.accountBank) {
        this.$refs.wxSumbitForm.clearValidate('accountBank');
      }
      console.log(item);
      // console.log('http://' + window.location.host.split(':')[0]);
      if (item == '其他银行') {
        this.otherBanks = !this.otherBanks;
      } else {
        this.otherBanks = false;
      }
    },

    //是否要关闭抽屉
    cancelForm () { },
    // 表单重置
    resetForm (formName) {
      this.$nextTick(() => {
        this.$refs[formName].resetFields();
        this.wxSumbitForm.checked = false
        this.picListFn();
      });
    },
    // 对正则进行校验 ok了进行下一步
    submit (formName) {
      // this.loading = true;
      console.log(this.wxSumbitForm);
      console.log(formName);
      this.$refs[formName].validate((valid) => {
        if (valid) {
          if (this.selectIncomingTypeStatus == 0) {
            this.wxSumbitFn();
          } else {
            this.zfbSumbit();
          }
        } else {
          this.$message.error('参数填充有误,请填写完整参数在提交');
          return false;
        }
      });
    },
    async wxUploadBj () {
      if (this.fileList.length < 1) {
        console.log('请选择文件后提交');
        this.$message.error('请选择文件后提交');
        return;
      }

      this.disabled = true;
      this.data = await userOssSignature();
      console.log(this.fileList[this.fileList.length - 1]);

      let file = this.fileList[this.fileList.length - 1].raw;
      let imgType = this.fileList[this.fileList.length - 1].imgType;
      let filename = file.name;
      let markIndex = filename.lastIndexOf('.');
      let suffix = filename.substring(markIndex);
      let date = new Date().getTime();
      // 构建请求参数
      let param = new FormData();
      param.append('key', this.data.dir + imgType + '/' + date + suffix);
      param.append('policy', this.data.policy);
      param.append('OSSAccessKeyId', this.data.accessId);
      param.append('success_action_status', '200');
      // param.append("callback",  this.data.callback)     //回调（not)
      param.append('signature', this.data.signature);
      param.append('file', file, file.name);
      param.append('success_action_status', '200');
      let config = {
        headers: {
          'Access-Control-Allow-Origin': '*',
          'x-oss-callback-Authorization': getToken()
        }
      };
      console.log('suffix', suffix);

      let res = await axios.post(this.data.host, param, config);
      let url;
      if (res.status == 200) {
        url = this.data.host + '/' + imgType + '/' + date + suffix;

        console.log('上传图片成功=======', res);
        console.log('this.data.host', url);

        this.wxPictureArr.push({ picUrls: url, uid: file.uid });
      } else {
        this.$message.error('上传失败');
      }

      const result = await wxGetUploadMediaId([url]);

      // console.log(result);

      // 当个MediaId 是字符串 多个是数组  营业执照和正反面的身份证是字符串格式其他的都是数组格式
      if (result.data.code == 200) {
        if (imgType == 'licenseCopy') {
          // 营业执照照片
          this.wxSumbitForm.licenseCopyMediaId = [
            { id: result.data.data.mediaId, uid: file.uid }
          ];
          console.log(this.wxSumbitForm.licenseCopyMediaId);
        } else if (imgType == 'storeEntrancePic') {
          // 门头照片
          this.wxSumbitForm.storeEntrancePicMediaId.push({
            id: result.data.data.mediaId,
            uid: file.uid
          });
          console.log(this.wxSumbitForm.storeEntrancePic);
        } else if (imgType == 'indoorPic') {
          // 办公环境
          this.wxSumbitForm.indoorPicMediaId.push({
            id: result.data.data.mediaId,
            uid: file.uid
          });
          console.log(this.wxSumbitForm.indoorPicMediaId);
        } else if (imgType == 'qualifications') {
          // 特殊资历
          this.wxSumbitForm.qualificationsMediaId.push({
            id: result.data.data.mediaId,
            uid: file.uid
          });
          console.log(this.wxSumbitForm.qualificationsMediaId);
        } else if (imgType == 'idCardCopy') {
          // 正面身份证头像
          this.wxSumbitForm.idCardCopyMediaId = [
            { id: result.data.data.mediaId, uid: file.uid }
          ];
          console.log(this.wxSumbitForm.idCardCopyMediaId);
        } else if (imgType == 'idCardNational') {
          // 反面身份证头像
          this.wxSumbitForm.idCardNationalMediaId = [
            { id: result.data.data.mediaId, uid: file.uid }
          ];
          console.log(this.wxSumbitForm.idCardNationalMediaId);
        }

        this.disabled = false;
      }
    },
    async zfbUploadBj () {
      if (this.fileList.length < 1) {
        console.log('请选择文件后提交');
        this.$message.error('请选择文件后提交');
        return;
      }
      this.data = await userOssSignature();

      let file = this.fileList[this.fileList.length - 1].raw;
      let imgType = this.fileList[this.fileList.length - 1].imgType;
      let filename = file.name;
      let markIndex = filename.lastIndexOf('.');
      let suffix = filename.substring(markIndex);
      let date = new Date().getTime();
      // 构建请求参数
      let param = new FormData();
      param.append('key', this.data.dir + imgType + '/' + date + suffix);
      param.append('policy', this.data.policy);
      param.append('OSSAccessKeyId', this.data.accessId);
      param.append('success_action_status', '200');
      // param.append("callback",  this.data.callback)     //回调（not)
      param.append('signature', this.data.signature);
      param.append('file', file, file.name);
      param.append('success_action_status', '200');
      let config = {
        headers: {
          'Access-Control-Allow-Origin': '*',
          'x-oss-callback-Authorization': getToken()
        }
      };
      console.log('suffix', suffix);

      let res = await axios.post(this.data.host, param, config);
      let url;
      if (res.status == 200) {
        url = this.data.host + '/' + imgType + '/' + date + suffix;

        console.log('上传图片成功=======', res);
        console.log('this.data.host', url);

        this.zfbPictureArr.push({ picUrls: url, uid: file.uid });
      } else {
        this.$message.error('上传失败');
      }
      //  获取到id
      const result = await zfbGetUploadMediaId([url]);

      console.log(result);

      // 当个MediaId 是字符串 多个是数组  营业执照和正反面的身份证是字符串格式其他的都是数组格式
      if (result.data.code == 200) {
        if (imgType == 'licenseCopy') {
          // 营业执照照片
          this.zfbSumbitForm.licenseCopyMediaId = result.data.data.imageId;
          console.log(this.zfbSumbitForm.licenseCopyMediaId);
        } else if (imgType == 'outDoorImages') {
          // 门头照片
          this.zfbSumbitForm.outDoorImagesOssKey.push({
            id: result.data.data.mediaId,
            uid: file.uid
          });
          // console.log(this.zfbSumbitForm.storeEntrancePic)
        } else if (imgType == 'inDoorImages') {
          // 办公环境
          this.zfbSumbitForm.inDoorImagesOssKey.push({
            id: result.data.data.mediaId,
            uid: file.uid
          });
        } else if (imgType == 'certImage') {
          // 正面身份证头像
          this.zfbSumbitForm.certImageOssKey = [
            { id: result.data.data.mediaId, uid: file.uid }
          ];
        } else if (imgType == 'certImageBack') {
          // 反面身份证头像
          this.zfbSumbitForm.certImageBackOssKey = [
            { id: result.data.data.mediaId, uid: file.uid }
          ];
        }
      }
    },
    wxSumbitFilter () {
      console.log(this.wxPictureArr);
      this.pictureList = [];

      //  对图片进行分类
      this.wxPictureArr.forEach((item) => {
        this.pictureList.push(item.picUrls);
      });

      // 获取到不同的图片地址然后放到from表单中
      // 营业执照照片
      let licenseCopy = this.pictureList.filter((url) =>
        url.includes('licenseCopy')
      );

      if (licenseCopy.length) {
        this.wxSumbitForm.licenseCopy = licenseCopy.join(',');
      }
      // 线下场所门头照片
      let storeEntrancePic = this.pictureList.filter((url) =>
        url.includes('storeEntrancePic')
      );
      if (storeEntrancePic.length) {
        this.wxSumbitForm.storeEntrancePic = storeEntrancePic.join(',');
      }
      // 办公环境
      let indoorPic = this.pictureList.filter((url) =>
        url.includes('indoorPic')
      );
      if (indoorPic.length) {
        this.wxSumbitForm.indoorPic = indoorPic.join(',');
      }
      // 特殊资质图片
      let qualifications = this.pictureList.filter((url) =>
        url.includes('qualifications')
      );
      if (qualifications.length) {
        this.wxSumbitForm.qualifications = qualifications.join(',');
      }
      // 身份证正面头像
      let idCardCopy = this.pictureList.filter((url) =>
        url.includes('idCardCopy')
      );
      if (idCardCopy.length) {
        this.wxSumbitForm.idCardCopy = idCardCopy.join(',');
      }
      // 身份证反面头像
      let idCardNational = this.pictureList.filter((url) =>
        url.includes('idCardNational')
      );
      if (idCardNational.length) {
        this.wxSumbitForm.idCardNational = idCardNational.join(',');
      }
      console.log(this.wxSumbitForm);
    },
    zfbSumbitFilter () {
      //  对图片进行分类
      this.pictureList = [];
      this.zfbPictureArr.forEach((item) => {
        this.pictureList.push(item.picUrls);
      });

      // 获取到不同的图片地址然后放到from表单中
      console.log(this.pictureList);
      let outDoorImagesPic = this.pictureList.filter((url) =>
        url.includes('outDoorImages')
      );
      this.zfbSumbitForm.outDoorImages = outDoorImagesPic.join(',');
      // 办公环境
      let inDoorImagesPic = this.pictureList.filter((url) =>
        url.includes('inDoorImages')
      );
      this.zfbSumbitForm.inDoorImages = inDoorImagesPic.join(',');

      // 身份证正面头像
      let certImagePic = this.pictureList.filter(
        (url) => url.includes('certImage') && !url.includes('certImageBack')
      );
      console.log(certImagePic);
      this.zfbSumbitForm.certImage = certImagePic.join(',');
      // 身份证反面头像
      let certImageBackPic = this.pictureList.filter((url) =>
        url.includes('certImageBack')
      );
      this.zfbSumbitForm.certImageBack = certImageBackPic.join(',');

      console.log(this.wxSumbitForm);
    },
    async wxSumbitFn () {
      if (this.incomingStatus !== '3' || this.restSubmitStatus) {
        this.wxSumbitFilter();
      }

      // 把submitFrom 转化为  {merchantsapplyfor:{}，businesslicense：{}}
      console.log(this.wxSumbitForm);

      let params = {
        merchantsapplyfor: {
          businessCode:
            this.incomingStatus == '3' ? this.resubmitId.businessCode : '',
          id: this.rejectReason ? this.resubmitId.applymentId : '',
          merchantId: this.wxSumbitForm.merchantId,
          subordinateAgent: this.wxSumbitForm.subordinateAgent,
          mobilePhone: this.wxSumbitForm.mobilePhone,
          contactEmail: this.wxSumbitForm.contactEmail,
          subjectType: this.wxSumbitForm.subjectType,
          idDocType: this.wxSumbitForm.idDocType,
          idCardCopy: this.wxSumbitForm.idCardCopy,
          // 身份证正面
          idCardCopyMediaId:
            this.incomingStatus == '3'
              ? this.wxSumbitForm.idCardCopyMediaId
                .map((item) => item.id)
                .join()
              : this.wxSumbitForm.idCardCopyMediaId
                .map((item) => item.id)
                .join(),
          idCardNational: this.wxSumbitForm.idCardNational,
          // 身份证反面
          idCardNationalMediaId:
            this.incomingStatus == '3'
              ? this.wxSumbitForm.idCardNationalMediaId
                .map((item) => item.id)
                .join()
              : this.wxSumbitForm.idCardNationalMediaId
                .map((item) => item.id)
                .join(),

          idCardName: this.wxSumbitForm.idCardName,
          idCardNumber: this.wxSumbitForm.idCardNumber,
          idCardAddress: this.wxSumbitForm.idCardAddress,
          cardPeriodBegin: this.wxSumbitForm.cardPeriodBegin,
          cardPeriodEnd: this.wxSumbitForm.cardPeriodEnd
        },
        businesslicense: {
          id: this.rejectReason ? this.resubmitId.businessLicenseId : '',
          licenseCopy: this.wxSumbitForm.licenseCopy,
          // 营业执照 MediaId
          licenseCopyMediaId:
            this.incomingStatus == '3'
              ? this.wxSumbitForm.licenseCopyMediaId
                .map((item) => item.id)
                .join()
              : this.wxSumbitForm.licenseCopyMediaId
                .map((item) => item.id)
                .join(),
          licenseNumber: this.wxSumbitForm.licenseNumber,
          merchantName: this.wxSumbitForm.merchantName,
          legalPerson: this.wxSumbitForm.legalPerson,
          licenseAddress: this.wxSumbitForm.licenseAddress,
          periodBegin: this.wxSumbitForm.periodBegin,
          periodEnd: this.wxSumbitForm.periodEnd
            ? this.wxSumbitForm.periodEnd
            : '长期'
        },
        bankaccount: {
          id: this.rejectReason ? this.resubmitId.bankAccountId : '',
          bankAccountType: this.wxSumbitForm.bankAccountType,
          accountName: this.wxSumbitForm.accountName,
          accountBank: this.wxSumbitForm.accountBank,
          bankBranchId: this.wxSumbitForm.bankBranchId,
          bankName: this.wxSumbitForm.bankName,
          accountNumber: this.wxSumbitForm.accountNumber,
          bankAddressCode: this.bankAddressCode()
        },
        businessinfo: {
          id: this.rejectReason ? this.resubmitId.businessInformationId : '',
          merchantShortname: this.wxSumbitForm.merchantShortname,
          servicePhone: this.wxSumbitForm.servicePhone,

          bizStoreName: this.wxSumbitForm.bizStoreName,
          bizAddressCode: this.bizAddressCode(),
          bizStoreAddress: this.wxSumbitForm.bizStoreAddress,
          storeEntrancePic: this.wxSumbitForm.storeEntrancePic,
          // 门头照片 MediaId
          storeEntrancePicMediaId:
            this.incomingStatus == '3'
              ? this.wxSumbitForm.storeEntrancePicMediaId.map(
                (item) => item.id
              )
              : this.wxSumbitForm.storeEntrancePicMediaId.map(
                (item) => item.id
              ),
          indoorPic: this.wxSumbitForm.indoorPic,
          // 线下场所内部照片
          indoorPicMediaId:
            this.incomingStatus == '3'
              ? this.wxSumbitForm.indoorPicMediaId.map((item) => item.id)
              : this.wxSumbitForm.indoorPicMediaId.map((item) => item.id)
        },
        settlement: {
          settlementId: this.wxSumbitForm.settlementId,
          qualificationType: this.wxSumbitForm.qualificationType,
          qualifications: this.wxSumbitForm.qualifications,
          // 特殊资质 MediaId
          qualificationsMediaId:
            this.incomingStatus == '3'
              ? this.wxSumbitForm.qualificationsMediaId.map((item) => item)
              : this.wxSumbitForm.qualificationsMediaId.map(
                (item) => item.id
              ),
          //   activitiesRate: this.wxSumbitForm.activitiesRate,
          id: this.rejectReason ? this.resubmitId.settlementId : ''
        }
      };
      console.log(params);

      try {
        this.loading = true;
        const res = await wxSumbitMerchantApplyFor(params);
        console.log(res);
        if (res.data.code == 2000) {
          this.$message({
            message: res.data.msg,
            type: 'success'
          });
          this.resetForm('wxSumbitForm')
          this.incomingStatus = 2
          this.init()
          this.loading = false;
        }
        if (res.data.code == 5000) {
          this.$message.error(res.data.msg);
          this.loading = false;
        }
      } catch (error) {
        this.$message.error(error);
      }
      this.pictureList = [];
      this.wxPictureArr = [];
    },
    async zfbSumbit () {
      this.zfbSumbitFilter();
      let params = {
        alipaymerchant: {
          // mcc
          mcc: this.zfbSumbitForm.mcc[1],
          // 商户类型
          merchantType: this.zfbSumbitForm.merchantType,
          // 商户名称
          name: this.zfbSumbitForm.name,
          // 商户别名
          aliasName: this.zfbSumbitForm.aliasName,

          // 商户证件编号
          certNo: this.zfbSumbitForm.certNo,
          // 商户证件类型
          certType: this.zfbSumbitForm.certType,
          // 法人名称
          legalName: this.zfbSumbitForm.legalName,
          // 法人身份证号
          legalCertNo: this.zfbSumbitForm.legalCertNo,
          // 联系人姓名
          contactName: this.zfbSumbitForm.contactName,
          // 联系人电话
          contactMobile: this.zfbSumbitForm.contactMobile,
          // 商户使用服务
          service: this.zfbSumbitForm.serviceList.join(','),
          // 商户使用服务  String[]
          serviceList: this.zfbSumbitForm.serviceList,
          // 结算支付宝账号
          alipayLogonId: this.zfbSumbitForm.alipayLogonId,
          // 营业执照名称
          certName: this.zfbSumbitForm.certName,
          // 签约支付宝账户
          bindingAlipayLogonId: this.zfbSumbitForm.bindingAlipayLogonId,
          // 默认结算类型
          defaultSettleType: this.zfbSumbitForm.defaultSettleType,
          // 默认结算目标
          defaultSettleTarget: this.zfbSumbitForm.defaultSettleTarget,
          // 办公环境
          inDoorImages: this.zfbSumbitForm.inDoorImages,
          // 办公环境OssKey
          inDoorImagesOssKey: this.zfbSumbitForm.inDoorImagesOssKey.map(
            (item) => item.id
          ),
          // 商户证件图片url
          certImage: this.zfbSumbitForm.certImage,
          // 商户证件图片urlOssKey
          certImageOssKey: this.zfbSumbitForm.certImageOssKey.map(
            (item) => item.id
          ),

          // 证件反面图片
          certImageBack: this.zfbSumbitForm.certImageBack,
          // 证件反面图片OssKey
          certImageBackOssKey: this.zfbSumbitForm.certImageBackOssKey.map(
            (item) => item.id
          ),
          // 城市编码
          cityCode: this.zfbSumbitForm.cityCode,
          // 区县编码
          districtCode: this.zfbSumbitForm.districtCode,
          // 营业执照地址
          address: this.zfbSumbitForm.address,
          // 省份编码
          provinceCode: this.zfbSumbitForm.provinceCode,
          // 门头照
          outDoorImages: this.zfbSumbitForm.outDoorImages,
          // 门头照OssKey
          outDoorImagesOssKey: this.zfbSumbitForm.outDoorImagesOssKey.map(
            (item) => item.id
          )
        },
        settlecardinfo: {
          // 卡户名
          accountHolderName: this.zfbSumbitForm.accountHolderName,
          // 银行卡号
          accountNo: this.zfbSumbitForm.accountNo,
          // 开户行所在地-省
          accountInstProvince: this.zfbSumbitForm.accountInstProvince,
          // 开户行所在地-市
          accountInstCity: this.zfbSumbitForm.accountInstCity,
          // 开户支行名
          accountBranchName: this.zfbSumbitForm.accountBranchName,
          // 账号使用类型
          usageType: this.zfbSumbitForm.usageType,
          // 银行卡类型
          accountType: this.zfbSumbitForm.accountType,
          // 银行名称
          accountInstName: this.zfbSumbitForm.accountInstName,
          // 开户行简称缩写
          accountInstId: this.zfbSumbitForm.accountInstId
        }
      };

      console.log(params);
      try {
        const res = await zfbMerchantCreate(params);
        console.log(res);
        if (res.data.code == 2000) {
          this.$message({
            message: res.data.msg,
            type: 'success'
          });
        }
        if (res.data.code == 5000) {
          this.$message.error(res.data.msg);
        }
      } catch (error) {
        this.$message.error(error);
      }
      this.pictureList = [];
    },
    // 获取第在的code编码
    bankAddressCode () {
      if (this.wxSumbitForm.bankAddressCode) {
        if (this.rejectReason) {
          const res = this.wxSumbitForm.bankAddressCode
          return res
        } else {
          const res =
            this.wxSumbitForm.bankAddressCode?.[
            this.wxSumbitForm.bankAddressCode.length - 1
            ];
          return res;
        }
      }
    },

    bizAddressCode () {
      if (this.wxSumbitForm.bizAddressCode) {
        if (this.rejectReason) {
          const res = this.wxSumbitForm.bizAddressCode
          return res
        } else {
          const res =
            this.wxSumbitForm.bizAddressCode?.[
            this.wxSumbitForm.bizAddressCode.length - 1
            ];
          return res;
        }
      }
    },

    // 提交图片之前的一些限制
    beforeAvatarUpload (file) {
      // const isJPG = file.type === 'image/jpeg';
      console.log(file);
      const isJPG = file.raw.type;
      const isLt2M = file.raw.size / 1024 / 1024 < 2;

      const extension1 = file.raw.type === 'image/jpg';
      const extension2 = file.raw.type === 'image/jpeg';
      const extension3 = file.raw.type === 'image/png';
      const extension4 = file.raw.type === 'image/bmp';
      if (!extension1 && !extension2 && !extension3 && !extension4) {
        this.$message.error('请上传jpg 、png、jpeg、bmp 类型图片!');
        return;
      }
      if (!isLt2M) {
        this.$message.error('上传图片大小不能超过 2MB!');
        return;
      }
      return isJPG && isLt2M;
    },
    //   图片设置为[]
    picListFn () {
      //  全部赋值为[]
      this.licenseCopyFileList = [];
      this.storeEntrancePicFileList = [];
      this.indoorPicFileList = [];
      this.qualificationsFileList = [];
      this.idCardCopyFileList = [];
      this.idCardNationalFileList = [];
    },
    // 这里对图片上传以后当图片数量大于0则去除校验提示
    handleFileChange (file, fileList, name) {
      if (file.status !== 'ready') return;
      const isPass = this.beforeAvatarUpload(file);
      console.log(isPass);
      if (!isPass) {
        this.handleRemove(file, name);
        return;
      }

      //图片上传后
      console.log(file);
      this.listLength = fileList.length;
      if (name == 'licenseCopy') {
        this.wxSumbitForm.licenseCopy = file.name;
      } else if (name == 'qualifications') {
        this.wxSumbitForm.qualifications = file.name;
      } else if (name == 'storeEntrancePic') {
        this.wxSumbitForm.storeEntrancePic = file.name;
      } else if (name == 'indoorPic') {
        this.wxSumbitForm.indoorPic = file.name;
      } else if (name == 'idCardCopy') {
        this.wxSumbitForm.idCardCopy = file.name;
      } else if (name == 'idCardNational') {
        this.wxSumbitForm.idCardNational = file.name;
      } else if (name == 'inDoorImages') {
        this.zfbSumbitForm.inDoorImages = file.name;
      } else if (name == 'certImage') {
        this.zfbSumbitForm.certImage = file.name;
      } else if (name == 'certImageBack') {
        this.zfbSumbitForm.certImageBack = file.name;
      } else if (name == 'outDoorImages') {
        this.zfbSumbitForm.outDoorImages = file.name;
      }

      fileList.forEach((item) => {
        item.imgType = name;
      });
      let files = fileList[fileList.length - 1];
      this.fileList.push(files);
      console.log(file, fileList, this.fileList, name);
      if (this.listLength > 0) {
        // 这里还需要判断一下图片的类型 只有有当前的类型才去除验证
        const fileObject = this.fileList.find((item, index) => {
          return item.imgType == name;
        });
        if (this.selectIncomingTypeStatus == 0) {
          this.$refs.wxSumbitForm.clearValidate(fileObject.imgType); //当图片数量大于0则去除校验提示
        } else {
          this.$refs.zfbSumbitForm.clearValidate(fileObject.imgType); //当图片数量大于0则去除校验提示
        }
      }
      if (this.selectIncomingTypeStatus == 0) {
        this.restSubmitStatus = true;
        this.wxUploadBj();
      } else {
        this.zfbUploadBj();
      }
    },
    //  图片上传个数超过限制
    exceedFn () {
      this.$message({
        message: '图片上传已达到上限,请删除后再上传',
        type: 'warning'
      });
    },

    // 营业执照有效时间
    businessLicense (timeArr, periodName) {
      console.log(timeArr, periodName);
      //   开始时间
      if (periodName == 'periodBegin') {
        this.wxSumbitForm.periodBegin = timeArr;
      } else {
        //   结束时间
        this.wxSumbitForm.periodEnd = timeArr;
      }
    },
    // 身份证有效时间
    IDCardDateRange (timeArr) {
      console.log(timeArr);
      //   开始时间
      this.wxSumbitForm.cardPeriodBegin = timeArr[0];
      //   结束时间
      this.wxSumbitForm.cardPeriodEnd = timeArr[1];
    },
    // 点击按钮预览图片
    onPreview () {
      this.showViewer = true;
    },
    // 关闭查看器
    closeViewer () {
      this.showViewer = false;
    },

    // 查询代理类型
    async init () {
      // 146
      this.picListFn();
      const res = await selectByPrimaryKey({
        merchantId: this.$store.state.user.info.merchantId
      });

      console.log(res);
      const obj1 = res.data;
      list[0] = obj1;
      console.log(list);
      this.detailsList = [obj1];
      console.log('跳出弹框返回状态');
      if (res.msg == '该商家没有进件信息') {
        this.incomingStatus = 1;
        // 未进件状态

        return;
      }
      // 判断当前 状态 1 为 未进件 2 为 进件中 3进件失败 4待用户验证  5进件成功代签约 6开通权限中 7进件成功 8已经作废 9状态为 该商家无法进件
      this.incomingStatus = res.data.merchantsapplyfor.merchanApplyForStatus;
      if (this.incomingStatus == 5) {
        this.signUrl = res.data.merchantsapplyfor.signUrl;
      }
      if (this.incomingStatus == 3) {
        this.IncomingOrNot = 4;

        this.wxSumbitForm.IDCardDateRange = [];
        this.rejectReason = res.data.merchantsapplyfor.rejectReason;

        this.resubmitId.applymentId = res.data.merchantsapplyfor.id;
        this.resubmitId.bankAccountId = res.data.bankaccount.id;
        this.resubmitId.settlementId = res.data.settlement.id;
        this.resubmitId.businessInformationId = res.data.businessinfo.id;
        this.resubmitId.businessLicenseId = res.data.businesslicense.id;
        this.resubmitId.businessCode =
          res.data.merchantsapplyfor.businessCode;
        console.log(this.rejectReason);
        let rejectReason = {
          ...obj1.bankaccount,
          ...obj1.settlement,
          ...obj1.merchantsapplyfor,
          ...obj1.businessinfo,
          ...obj1.businesslicense
        };
        this.rejectReasonObject = rejectReason

      }
      if (this.incomingStatus == 7) {
        this.IncomingOrNot = 2;
      }
    },

    /* 表格数据源 */
    datasource ({ page, limit, where, order }) {
      //   console.log(where, order);
      if (!where.deleted) where.deleted = 0;
      return pageMerchant({ ...where, ...order, page, limit, oemType: 1 });
    },
    /* 刷新表格 */
    reload (where) {
      console.log('where', where);
      this.$refs.table.reload({ page: 1, where: where });
    },
    modifyRate () {
      this.current = null;
      this.showEdit = true;
    },
    /* 打开划拨编辑弹窗 */
    openTransfer (row) {
      this.current = row;
      this.showTransfer = true;
    },
    /* 打开导入弹窗 */
    openImport () {
      this.showImport = true;
    },
    /* 删除 */
    remove (row) {
      const loading = this.$loading({ lock: true });
      removeUsers({ ids: [row.id] })
        .then((msg) => {
          loading.close();
          this.$message.success(msg);
          this.reload();
        })
        .catch((e) => {
          loading.close();
          this.$message.error(e.message);
        });
    },
    /*重置密码*/
    resets (row) {
      const loading = this.$loading({ lock: true });
      console.log('row', row);
      resetPassword({ id: row.id })
        .then((msg) => {
          loading.close();
          this.$message.success(msg);
          this.reload();
        })
        .catch((e) => {
          loading.close();
          this.$message.error(e.message);
        });
    },
    /* 批量删除 */
    removeBatch () {
      if (!this.selection.length) {
        this.$message.error('请至少选择一条数据');
        return;
      }
      this.$confirm('确定要删除选中的代理吗?', '提示', {
        type: 'warning'
      })
        .then(() => {
          const loading = this.$loading({ lock: true });
          removeUsers({ ids: this.selection.map((d) => d.id) })
            .then((msg) => {
              loading.close();
              this.$message.success(msg);
              this.reload();
            })
            .catch((e) => {
              loading.close();
              this.$message.error(e.message);
            });
        })
        .catch(() => { });
    },
    /* 更改状态 */
    editStatus (row) {
      const loading = this.$loading({ lock: true });
      updateUserStatus(row.id, row.status)
        .then((msg) => {
          console.log('msg=======', msg);
          loading.close();
          this.$message.success(
            row.status == 1 ? '启用成功！' : '冻结成功！'
          );
        })
        .catch((e) => {
          loading.close();
          row.status = !row.status ? 1 : 0;
          this.$message.error(e);
        });
    },
    // 切换 0 为 个人 1 为企业
    async switchType (index) {
      this.wxSumbitForm.qualificationType = '';
      if (this.selectIncomingTypeStatus == 0) {
        this.wxSumbitForm.subjectType = index;
        // if (index == 'SUBJECT_TYPE_INDIVIDUAL') {
        //   //   个人 719
        //   this.wxSumbitForm.settlementId = '746';
        // } else {
        //   this.wxSumbitForm.settlementId = '716';
        // }
      } else {
        this.zfbSumbitForm.merchantType = index;
        // 01：企业；cert_type填写201（营业执照）；cert_no填写营业执照号；
        // 06：个人商户：cert_type填写100（个人身份证）；cert_no填写个人身份证号码；
        // 07：个体工商户：cert_type填写201（营业执照）；cert_no填写营业执照编号；

        if (index == '01') {
          this.zfbSumbitForm.certType = this.certTypeList.businessLicense;
        } else if ('06') {
          this.zfbSumbitForm.certType = this.certTypeList.personalIDCard;
        } else if ('07') {
          this.zfbSumbitForm.certType = this.certTypeList.businessLicense;
        }
      }

      this.initRules();
    },
    // 切换 0 为 微信 1 为支付宝
    incomingType (index) {
      this.selectIncomingTypeStatus = 0;

      if (index == 1) {
        // this.IncomingOrNot = 1;
        this.$message('支付宝进件当前在开发中敬请期待!');
      }
      if (index == 0) {
        // this.IncomingOrNot = 1;
      }
    }
  }
};
</script>

<style lang="less" scoped>
h6 {
  line-height: 1.5;
}

.loading-div {
  width: 100%;
  position: absolute;
}
/deep/.el-cascader--medium {
  width: 100%;
}
/deep/.el-select {
  min-width: 100%;
}
/deep/ .el-dialog__wrapper {
  z-index: 3000 !important;
}

.el-row-active {
  padding: 30px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.el-row {
  padding: 30px;
  min-width: 400px;
}
.fromSubmitThree {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 400px;
  padding: 0px 280px;
  line-height: 1.5;

  .examine {
    color: #000;
    margin-bottom: 29px;
    font-size: 24px;
  }
  .closePage {
    width: 186px;
    height: 60px;
    border-radius: 43px;
    border: 1px solid #1e6ceb;
    color: #1e6ceb;
    margin-top: 57px;
  }
  .resubmit {
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 186px;
    height: 60px;
    border-radius: 43px;
    background: #ff4d4f;
    // box-shadow: 0px 4px 4px 0px #ff4d4f;
    margin-top: 57px;
  }
}
.zfbIncoming() {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 283px;
  height: 90px;
  box-sizing: border-box;
  position: relative;

  .zfbHLabel {
    margin: 10px 0 20px;
    font-weight: 700;
    &::before {
      content: url('../../../static/svg/zfbIcon.svg');
      display: inline-block;
      vertical-align: middle;
      margin-top: 10px;
      margin-right: 10px;
    }
  }
  .zfbText {
    .zfbTextFontSize {
      color: #000;
      margin-bottom: 5px;
      font-size: 20px;
    }
    .activr-zfbTextFontSize {
      color: #0077e5;
      margin-bottom: 5px;
      font-size: 20px;
    }
  }
}

.wxIncoming() {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 283px;
  height: 90px;
  position: relative;
  box-sizing: border-box;
  .wxHLabel {
    margin: 15px 0 20px;
    font-weight: 700;
    &::before {
      content: url('../../../static/svg/wxIcon.svg');
      display: inline-block;
      vertical-align: middle;
      margin-top: 10px;
      margin-right: 10px;
    }
  }

  .wxText {
    .wxTextFontSize {
      color: #000;

      font-size: 20px;
      margin-bottom: 5px;
    }
    .activr-wxTextFontSize {
      color: #0077e5;
      margin-bottom: 5px;
      font-size: 20px;
    }
  }
}

.incomingTypeSwitch() {
  display: flex;
  align-items: center;
  justify-content: flex-start;

  .wxIncoming {
    margin-right: 25px;
    .wxIncoming();
  }

  .active-wxIncoming {
    margin-right: 25px;
    background: #e9f7ff;
    border-radius: 10px;
    border: 1px solid #1890ff;
    .wxIncoming();
    &::before {
      content: url('../../../static/check.png');
      position: absolute;
      width: 25px;
      height: 14px;
      border-radius: 10px 0px;
      border: 1px solid #1890ff;
      background: #1890ff;
      right: 0;
      bottom: 0;
      line-height: 17px;
      text-align: center;
    }
  }
  .zfbIncoming {
    //   background: #e9f7ff;
    .zfbIncoming();
  }
  .active-zfbIncoming {
    background: #e9f7ff;
    border-radius: 10px;
    border: 1px solid #1890ff;
    .zfbIncoming();
    &::before {
      content: url('../../../static/check.png');
      position: absolute;
      width: 25px;
      height: 14px;
      border-radius: 10px 0px;
      border: 1px solid #1890ff;
      background: #1890ff;
      right: 0;
      bottom: 0;
      line-height: 17px;
      text-align: center;
    }
  }
}
.el-row {
  padding: 30px;
}
.el-row-active {
  padding: 30px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zfb-purple {
  .zfbHLabel {
    margin: 15px 0 20px;
    font-weight: 700;
    &::before {
      content: url('../../../static/svg/zfbIcon.svg');
      display: inline-block;
      vertical-align: middle;

      margin-right: 5px;
    }
  }

  .fromSubmitOne {
    .subjectTypeSwitch {
      display: flex;
      height: 36px;
      line-height: 36px;
      justify-content: flex-start;
      border-radius: 3%;
      width: 160px;

      background-color: #fff;
      border: 1px solid #d9d9d9;
      text-align: center;
      .enterprise {
        //   overflow: hidden;
        background-color: #fff;
        width: 40%;
      }
      .individuality {
        color: #fff;
        background-color: #289aff;

        width: 60%;
      }
      .active-enterprise {
        width: 40%;
        color: #fff;
        background-color: #289aff;
      }
      .active-individuality {
        color: #606266;
        background-color: #fff;
        width: 60%;
      }
    }
    .incomingTypeSwitch {
      .incomingTypeSwitch();
    }

    .active-incomingTypeSwitch {
      .incomingTypeSwitch();
      padding-bottom: 30px;
      border-bottom: 1px solid #dadada;
    }
    .hLabel {
      margin: 15px 0 20px;
      font-weight: 700;
      &::before {
        content: '';
        display: inline-block;
        vertical-align: top;

        margin-right: 5px;
        height: 23px;
        width: 6px;
        background-color: #1e6ceb;
      }
    }
    .businessLicenseTime {
      display: flex;

      justify-content: flex-start;
      align-items: center;
    }
    /deep/.el-range-editor--medium.el-input__inner {
      width: 600px !important;
    }
    .ruleForm {
      /deep/.el-form-item__label {
        color: #000;
      }
      /deep/.el-form-item {
        max-width: 737px;
        min-width: 245px;
      }
      /deep/ .el-upload--picture-card {
        line-height: 178px;
      }
      span {
        color: #b4b4b4;
      }
      .rejectReasonCss {
        color: #ff4d4f;
        margin: 20px 0;
      }
    }
    .drawer__footer {
      max-width: 737px;
      min-width: 337px;

      display: flex;
      justify-content: space-between;
    }
  }
}
</style>
